cache_freelist Class
定义分配和释放内存块一个范围的 块分配器。
template <std::size_t Sz, class Max> class cache_freelist
参数
Parameter |
说明 |
---|---|
Sz |
元素数。将数组的。 |
Max |
表示最大大小的最大选件类的列表。 这可能是 max_fixed_size、max_none、max_unbounded或 max_variable_size。 |
备注
cache_freelist模板选件类维护空闲列表内存块范围 Sz。 当空闲列表时已满它使用 operator delete 释放内存块。 当空闲列表时为空它使用 operator new 分配新的内存块。 空闲列表中 Max 参数传递的选件类最大选件类取决于最大大小的。
operator new 和 operator delete 所需的每个内存块保留 Sz 字节可用内存和数据。
构造函数
构造对象类型 cache_freelist。 |
成员函数
分配内存块。 |
|
从存储开头释放对象指定数目的在指定的位置。 |
要求
标头: <allocators>
命名空间: stdext