OmniSciDB
a5dc49c757
|
#include <ArenaAllocator.h>
Public Member Functions | |
DramArena (size_t min_block_size=1ULL<< 32, size_t size_limit=0) | |
~DramArena () override | |
void * | allocate (size_t num_bytes) override |
void * | allocateAndZero (const size_t size) override |
size_t | bytesUsed () const override |
size_t | totalBytes () const override |
MemoryType | getMemoryType () const override |
Public Member Functions inherited from Arena | |
virtual | ~Arena () |
Private Attributes | |
size_t | size_limit_ |
size_t | size_ |
SysAllocator< void > | allocator_ |
std::vector< std::pair< void *, size_t > > | allocations_ |
Additional Inherited Members | |
Public Types inherited from Arena | |
enum | MemoryType { MemoryType::DRAM, MemoryType::PMEM } |
A naive allocator which calls malloc and maintains a list of allocate pointers for freeing. For development and testing only, where folly is not available. Not for production use.
Definition at line 119 of file ArenaAllocator.h.
|
inlineexplicit |
Definition at line 121 of file ArenaAllocator.h.
|
inlineoverride |
Definition at line 124 of file ArenaAllocator.h.
References allocations_, allocator_, SysAllocator< T >::deallocate(), and size_.
|
inlineoverridevirtual |
Implements Arena.
Definition at line 131 of file ArenaAllocator.h.
References SysAllocator< T >::allocate(), allocations_, allocator_, size_, and size_limit_.
Referenced by allocateAndZero().
|
inlineoverridevirtual |
Implements Arena.
Definition at line 141 of file ArenaAllocator.h.
References allocate().
|
inlineoverridevirtual |
|
inlineoverridevirtual |
|
inlineoverridevirtual |
|
private |
Definition at line 157 of file ArenaAllocator.h.
Referenced by allocate(), and ~DramArena().
|
private |
Definition at line 156 of file ArenaAllocator.h.
Referenced by allocate(), and ~DramArena().
|
private |
Definition at line 155 of file ArenaAllocator.h.
Referenced by allocate(), bytesUsed(), totalBytes(), and ~DramArena().
|
private |
Definition at line 154 of file ArenaAllocator.h.
Referenced by allocate().