CS::Memory::LocalBufferAllocator< T, N, ExcessAllocator > Class Template ReferenceAn allocator with a small local buffer. More...
Public Member Functions
|T *||Alloc (size_t allocSize)|
|void||Free (T *mem)|
|LocalBufferAllocator (const ExcessAllocator &xalloc)|
|void *||Realloc (void *p, size_t newSize)|
template<typename T, size_t N, class ExcessAllocator = AllocatorMalloc>
An allocator with a small local buffer.
class CS::Memory::LocalBufferAllocator< T, N, ExcessAllocator >
If the data fits into the local buffer (which is set up to holds
N elements of type
T), a memory allocation from the heap is saved. Thus, if you have lots of arrays with a relatively small, well known size you can gain some performance by using this allocator.
- This allocator is designed to work in scenarios where you have at most one block allocated at any time!
The pointer returned may point into the instance data; be careful when moving that around - an earlier allocated pointer may suddenly become invalid!
- This means that if you use this allocator with an array, and you nest that into another array, you MUST use csSafeCopyArrayElementHandler for the nesting array!
The documentation for this class was generated from the following file:
Generated for Crystal Space 1.0.2 by doxygen 1.4.7