|
cds
1.4.0
|
Page cacheable heap. More...
#include <cds/memory/michael/allocator.h>
Public Member Functions | |
| page_cached_allocator (size_t nPageSize) | |
| Initializes heap. More... | |
| void * | alloc () |
| Allocate new page. | |
| void | free (void *pPage) |
Free page pPage. | |
Public Member Functions inherited from cds::memory::michael::page_allocator< Heap > | |
| page_allocator (size_t nPageSize) | |
| Initializes heap. More... | |
| void * | alloc () |
| Allocate new page. | |
| void | free (void *pPage) |
Free page pPage. | |
Public Member Functions inherited from cds::memory::michael::Heap< Options > | |
| Heap () | |
| Heap constructor. | |
| ~Heap () | |
| Heap destructor. More... | |
| void * | alloc (size_t nSize) |
| Allocate memory block. More... | |
| void | free (void *pMemory) |
| Free previously allocated memory block. More... | |
| void * | realloc (void *pMemory, size_t nNewSize) |
| Reallocate memory block. More... | |
| void * | alloc_aligned (size_t nSize, size_t nAlignment) |
| Allocate aligned memory block. More... | |
| void | free_aligned (void *pMemory) |
| Free aligned memory block previously allocated by alloc_aligned. More... | |
| void | summaryStat (summary_stat &st) |
| Get instant summary statistics. | |
Additional Inherited Members | |
Public Types inherited from cds::memory::michael::Heap< Options > | |
| enum | superblock_state { SBSTATE_ACTIVE = 0, SBSTATE_FULL = 1, SBSTATE_PARTIAL = 2, SBSTATE_EMPTY = 3 } |
| Superblock states. More... | |
| typedef options::sys_topology | sys_topology |
| effective system topology | |
| typedef options::system_heap | system_heap |
| effective system heap | |
| typedef options::aligned_heap | aligned_heap |
| effective aligned heap | |
| typedef options::sizeclass_selector | sizeclass_selector |
| effective sizeclass selector | |
| typedef options::page_heap | page_heap |
| effective page heap | |
| typedef options::procheap_stat | procheap_stat |
| effective processor heap statistics | |
| typedef options::os_allocated_stat | os_allocated_stat |
| effective OS-allocated memory statistics | |
|
typedef details::bound_checker_selector < typename options::check_bounds > | bound_checker |
| effective bound checker | |
|
typedef cds::details::type_padding < processor_heap_base, c_nAlignment >::type | processor_heap |
| Aligned superblock descriptor. | |
Static Public Attributes inherited from cds::memory::michael::Heap< Options > | |
| static const size_t | c_nMaxBlockInSuperBlock = 1024 * 2 |
| Max count of blocks in superblock (2 ** 11) | |
Protected Attributes inherited from cds::memory::michael::Heap< Options > | |
| sys_topology | m_Topology |
| System topology. | |
| system_heap | m_LargeHeap |
| Heap for large block. | |
| aligned_heap | m_AlignedHeap |
| Internal aligned heap. | |
| sizeclass_selector | m_SizeClassSelector |
| Size-class selector. | |
| std::atomic< processor_desc * > * | m_arrProcDesc |
| array of pointers to the processor descriptors | |
| unsigned int | m_nProcessorCount |
| Processor count. | |
| bound_checker | m_BoundChecker |
| Bound checker. | |
| os_allocated_stat | m_OSAllocStat |
| OS-allocated memory statistics. | |
Page cacheable heap.
To improve performance this allocator maintains small list of free pages. Page heap can allocate memory by page-sized block only.
Template parameters:
FreeListCapacity - capacity of free-list, default value is 64 page Heap may be any heap that provides interface like malloc_heap.This class is one of available implementation of opt::page_heap option.
|
inline |
Initializes heap.
| nPageSize | page size in bytes |