다음을 통해 공유


cache_chunklist 클래스

Defines a block allocator that allocates and deallocates memory blocks of a single size.

template <std::size_t Sz, std::size_t Nelts = 20> class cache_chunklist

매개 변수

Parameter

설명

Sz

The number of elements in the array to be allocated.

설명

This template class uses operator new to allocate chunks of raw memory, suballocating blocks to allocate storage for a memory block when needed; it stores deallocated memory blocks in a separate free list for each chunk, and uses operator delete to deallocate a chunk when none of its memory blocks is in use.

Each memory block holds Sz bytes of usable memory and a pointer to the chunk that it belongs to. Each chunk holds Nelts memory blocks, three pointers, an int and the data that operator new and operator delete require.

생성자

cache_chunklist

'cache_chunklist' 형식의 개체를 생성합니다.

멤버 함수

allocate

Allocates a block of memory.

deallocate

Frees a specified number of objects from storage beginning at a specified position.

요구 사항

Header: <allocators>

네임스페이스: stdext

참고 항목

참조

<allocators>