proxygen
|
#include <CacheLocality.h>
Public Member Functions | |
SimpleAllocator (size_t allocSize, size_t sz) | |
~SimpleAllocator () | |
void * | allocateHard () |
void * | allocate () |
void | deallocate (void *mem) |
Private Attributes | |
std::mutex | m_ |
uint8_t * | mem_ {nullptr} |
uint8_t * | end_ {nullptr} |
void * | freelist_ {nullptr} |
size_t | allocSize_ |
size_t | sz_ |
std::vector< void * > | blocks_ |
A simple freelist allocator. Allocates things of size sz, from slabs of size allocSize. Takes a lock on each allocation/deallocation.
Definition at line 394 of file CacheLocality.h.
folly::SimpleAllocator::SimpleAllocator | ( | size_t | allocSize, |
size_t | sz | ||
) |
folly::SimpleAllocator::~SimpleAllocator | ( | ) |
Definition at line 241 of file CacheLocality.cpp.
References folly::aligned_free(), blocks_, g(), and m_.
|
inline |
void * folly::SimpleAllocator::allocateHard | ( | ) |
Definition at line 248 of file CacheLocality.cpp.
References folly::aligned_malloc(), allocSize_, blocks_, end_, folly::max_align_v, mem_, min, sz_, and uint8_t.
|
inline |
Definition at line 434 of file CacheLocality.h.
References g().
Referenced by folly::CoreRawAllocator< Stripes >::Allocator::deallocate().
|
private |
Definition at line 399 of file CacheLocality.h.
Referenced by allocateHard().
|
private |
Definition at line 401 of file CacheLocality.h.
Referenced by allocateHard(), and ~SimpleAllocator().
Definition at line 397 of file CacheLocality.h.
Referenced by allocateHard().
|
private |
Definition at line 398 of file CacheLocality.h.
|
private |
Definition at line 395 of file CacheLocality.h.
Referenced by ~SimpleAllocator().
Definition at line 396 of file CacheLocality.h.
Referenced by allocateHard().
|
private |
Definition at line 400 of file CacheLocality.h.
Referenced by allocateHard(), and SimpleAllocator().