다음을 통해 공유


cache_freelist 클래스

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

template <std::size_t Sz, class Max> class cache_freelist

매개 변수

Parameter

설명

Sz

The number of elements in the array to be allocated.

Max

The max class representing the maximum size of the free list. This can be max_fixed_size, max_none, max_unbounded, or max_variable_size.

설명

The cache_freelist template class maintains a free list of memory blocks of size Sz. When the free list is full it uses operator delete to deallocate memory blocks. When the free list is empty it uses operator new to allocate new memory blocks. The maximum size of the free list is determined by the class max class passed in the Max parameter.

Each memory block holds Sz bytes of usable memory and the data that operator new and operator delete require.

생성자

cache_freelist

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

멤버 함수

allocate

Allocates a block of memory.

deallocate

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

요구 사항

Header: <allocators>

네임스페이스: stdext

참고 항목

참조

<allocators>