allocator
c++ link temporary allocations in function to custom allocator?
I am currently working on some simple custom allocators in c++ which generally works allready. I also overloaded the new/delete operators to allocate memory from my own allocator. Anyways I came acros[详细]
2022-12-25 09:26 分类:问答Adding an allocator to a C++ class template for shared memory object creation
In short, my question is: If you have class, MyClass<T>, how can you change the class definition to support cases where you have MyClass<T, Alloc>, similar to how, say, STL vector provides[详细]
2022-12-23 01:31 分类:问答Extension wrapper malloc allocator for C++ STL
Apparently there is a “malloc_allocator” provided with gcc f开发者_StackOverflowor use with STL. It simply wraps malloc and free. There is also a hook for an out-of-memory handler. Where can I find[详细]
2022-12-19 23:00 分类:问答C++ STL Memory Allocator Compile Error
I\'m writing a C++ custom allocator for use with STL. When I put 开发者_如何学Gothe following code in the class definition, it compiles:[详细]
2022-12-19 13:36 分类:问答Is it possible to replace the memory allocator in a debug build of an MFC application?
I\'d like to make use of Electric Fence in an MFC application. I\'d like to track new/ delete, and if I can track malloc/ free that\'s an added bonus.[详细]
2022-12-19 07:28 分类:问答Freelists with concurrent allocators
Freelists are a common way to speed up allocation by reusing existing memory that was already allocated.Is there a way to use free-lists in a concurrent allocator, without incurring the overhead of a[详细]
2022-12-16 07:36 分类:问答STL allocators and operator new[]
Are there STL implementations that use operator new[] as an allocator? On my compiler, making Foo:开发者_JS百科:operator new[] private did not prevent me from creating a vector<Foo>... is that b[详细]
2022-12-13 17:16 分类:问答Which allocator are available in STLPORT, and how to use them
We\'re using STLPORT and we\'d like to change stlport\'s default allocator: instead of vector<int&开发者_开发知识库gt;, we\'d like to try vector<int, otherallocator>[详细]
2022-12-11 11:08 分类:问答Account memory usage with custom allocator
I\'m using a custom allocator to account for memory usage in several containers. Currently I use a static variable to account for the memory usage. How could I separate this account across several con[详细]
2022-12-09 07:20 分类:问答Why isn't std::string::max_size() == std::string::allocator::max_size()
Recently I\'ve noticed that the following statement is not true given std::string s. s.max_size() == s.get_allocator().max_size();[详细]
2022-12-08 18:29 分类:问答