Kommentar
Åtkomst till den här sidan kräver auktorisering. Du kan prova att logga in eller ändra kataloger.
Åtkomst till den här sidan kräver auktorisering. Du kan prova att ändra kataloger.
Defines a block allocator that allocates and deallocates memory blocks of a single size.
template <std::size_t Sz, size_t Nelts = 20> class cache_suballoc
Parameters
Parameter |
Description |
|---|---|
Sz |
The number of elements in the array to be allocated. |
Remarks
The cache_suballoc template class stores deallocated memory blocks in a free list with unbounded length, using freelist<sizeof(Type), max_unbounded>, and suballocates memory blocks from a larger chunk allocated with operator new when the free list is empty.
Each chunk holds Sz * Nelts bytes of usable memory and the data that operator new and operator delete require. Allocated chunks are never freed.
Constructors
Constructs an object of type cache_suballoc. |
Member Functions
Allocates a block of memory. |
|
Frees a specified number of objects from storage beginning at a specified position. |
Requirements
Header: <allocators>
Namespace: stdext