CernVM-FS
2.12.0
|
#include <item_mem.h>
Public Member Functions | |
ItemAllocator () | |
~ItemAllocator () | |
void * | Malloc (unsigned size) |
void | Free (void *ptr) |
Static Public Member Functions | |
static int64_t | total_allocated () |
Private Attributes | |
std::vector< MallocArena * > | malloc_arenas_ |
unsigned | idx_last_arena_ |
pthread_mutex_t | lock_ |
Static Private Attributes | |
static const unsigned | kArenaSize = 128 * 1024 * 1024 |
static atomic_int64 | total_allocated_ = 0 |
This file is part of the CernVM File System. To avoid memory fragmentation, allocate the data buffer inside the BlockItem with a separate allocator.
Definition at line 20 of file item_mem.h.
ItemAllocator::ItemAllocator | ( | ) |
ItemAllocator::~ItemAllocator | ( | ) |
Definition at line 46 of file item_mem.cc.
void ItemAllocator::Free | ( | void * | ptr | ) |
Definition at line 16 of file item_mem.cc.
Referenced by BlockItem::Reset(), and BlockItem::~BlockItem().
void * ItemAllocator::Malloc | ( | unsigned | size | ) |
Definition at line 55 of file item_mem.cc.
Referenced by BlockItem::MakeData(), and BlockItem::MakeDataCopy().
|
inlinestatic |
Definition at line 28 of file item_mem.h.
|
private |
Where the last successful allocation took place.
Definition at line 38 of file item_mem.h.
|
staticprivate |
Definition at line 31 of file item_mem.h.
Referenced by Free(), ItemAllocator(), Malloc(), and ~ItemAllocator().
|
private |
Definition at line 39 of file item_mem.h.
Referenced by Free(), ItemAllocator(), Malloc(), and ~ItemAllocator().
|
private |
Definition at line 34 of file item_mem.h.
Referenced by Free(), ItemAllocator(), Malloc(), and ~ItemAllocator().
|
staticprivate |
This file is part of the CernVM File System.
Definition at line 32 of file item_mem.h.
Referenced by Free(), ItemAllocator(), Malloc(), total_allocated(), and ~ItemAllocator().