proxygen
|
#include <Arena.h>
Classes | |
struct | AllocAndSize |
struct | Block |
Public Member Functions | |
Arena (const Alloc &alloc, size_t minBlockSize=kDefaultMinBlockSize, size_t sizeLimit=kNoSizeLimit, size_t maxAlign=kDefaultMaxAlign) | |
~Arena () | |
void * | allocate (size_t size) |
void | deallocate (void *, size_t=0) |
void | merge (Arena &&other) |
size_t | totalSize () const |
size_t | bytesUsed () const |
Arena (const Arena &)=delete | |
Arena & | operator= (const Arena &)=delete |
Arena (Arena &&)=delete | |
Arena & | operator= (Arena &&)=delete |
Static Public Attributes | |
static constexpr size_t | kDefaultMinBlockSize = 4096 - sizeof(Block) |
static constexpr size_t | kNoSizeLimit = 0 |
static constexpr size_t | kDefaultMaxAlign = alignof(Block) |
static constexpr size_t | kBlockOverhead = sizeof(Block) |
Private Types | |
typedef boost::intrusive::slist_member_hook< boost::intrusive::tag< Arena > > | BlockLink |
typedef boost::intrusive::slist< Block, boost::intrusive::member_hook< Block, BlockLink,&Block::link >, boost::intrusive::constant_time_size< false >, boost::intrusive::cache_last< true > > | BlockList |
Private Member Functions | |
bool | isAligned (uintptr_t address) const |
bool | isAligned (void *p) const |
size_t | roundUp (size_t size) const |
void * | allocateSlow (size_t size) |
size_t | minBlockSize () const |
Alloc & | alloc () |
const Alloc & | alloc () const |
Private Attributes | |
AllocAndSize | allocAndSize_ |
BlockList | blocks_ |
char * | ptr_ |
char * | end_ |
size_t | totalAllocatedSize_ |
size_t | bytesUsed_ |
const size_t | sizeLimit_ |
const size_t | maxAlign_ |
|
private |
|
private |
|
inlineexplicit |
Definition at line 62 of file Arena.h.
Referenced by folly::Arena< SysAllocator< void > >::bytesUsed(), and folly::Arena< SysAllocator< void > >::totalSize().
folly::Arena< Alloc >::~Arena | ( | ) |
Definition at line 86 of file Arena-inl.h.
References folly::Arena< Alloc >::alloc(), b, and folly::Arena< Alloc >::blocks_.
Referenced by folly::Arena< SysAllocator< void > >::Arena().
|
delete |
|
delete |
|
inlineprivate |
Definition at line 194 of file Arena.h.
Referenced by folly::Arena< Alloc >::allocateSlow(), and folly::Arena< Alloc >::~Arena().
|
inlineprivate |
|
inline |
Definition at line 82 of file Arena.h.
Referenced by folly::ThreadCachedArena::allocate(), and TEST().
|
private |
Definition at line 44 of file Arena-inl.h.
References folly::Arena< Alloc >::alloc(), folly::Arena< Alloc >::Block::allocate(), folly::Arena< Alloc >::Block::Block(), folly::Arena< Alloc >::blocks_, folly::Arena< Alloc >::end_, folly::Arena< Alloc >::kNoSizeLimit, max, folly::Arena< Alloc >::minBlockSize(), folly::Arena< Alloc >::ptr_, folly::size(), folly::Arena< Alloc >::sizeLimit_, folly::Arena< Alloc >::Block::start(), folly::throw_exception(), and folly::Arena< Alloc >::totalAllocatedSize_.
Referenced by folly::Arena< SysAllocator< void > >::allocate().
|
inline |
|
inline |
|
inlineprivate |
Definition at line 159 of file Arena.h.
Referenced by folly::Arena< SysAllocator< void > >::allocate(), and folly::Arena< SysAllocator< void > >::isAligned().
|
inlineprivate |
void folly::Arena< Alloc >::merge | ( | Arena< Alloc > && | other | ) |
Definition at line 77 of file Arena-inl.h.
References folly::Arena< Alloc >::blocks_, and folly::Arena< Alloc >::totalAllocatedSize_.
Referenced by folly::Arena< SysAllocator< void > >::deallocate().
|
inlineprivate |
Definition at line 191 of file Arena.h.
Referenced by folly::Arena< Alloc >::allocateSlow(), and folly::SysArena::SysArena().
|
delete |
Referenced by folly::Arena< SysAllocator< void > >::bytesUsed().
|
delete |
|
inlineprivate |
Definition at line 167 of file Arena.h.
Referenced by folly::Arena< SysAllocator< void > >::allocate().
|
inline |
Definition at line 109 of file Arena.h.
Referenced by TEST().
|
private |
Definition at line 201 of file Arena.h.
Referenced by folly::Arena< SysAllocator< void > >::alloc(), and folly::Arena< SysAllocator< void > >::minBlockSize().
|
private |
Definition at line 202 of file Arena.h.
Referenced by folly::Arena< Alloc >::allocateSlow(), folly::Arena< Alloc >::merge(), and folly::Arena< Alloc >::~Arena().
|
private |
Definition at line 206 of file Arena.h.
Referenced by folly::Arena< SysAllocator< void > >::allocate(), and folly::Arena< SysAllocator< void > >::bytesUsed().
|
private |
Definition at line 204 of file Arena.h.
Referenced by folly::Arena< SysAllocator< void > >::allocate(), and folly::Arena< Alloc >::allocateSlow().
|
static |
|
static |
|
static |
|
static |
Definition at line 154 of file Arena.h.
Referenced by folly::Arena< Alloc >::allocateSlow().
|
private |
Definition at line 208 of file Arena.h.
Referenced by folly::Arena< SysAllocator< void > >::Arena(), folly::Arena< SysAllocator< void > >::isAligned(), and folly::Arena< SysAllocator< void > >::roundUp().
|
private |
Definition at line 203 of file Arena.h.
Referenced by folly::Arena< SysAllocator< void > >::allocate(), and folly::Arena< Alloc >::allocateSlow().
|
private |
Definition at line 207 of file Arena.h.
Referenced by folly::Arena< Alloc >::allocateSlow().
|
private |
Definition at line 205 of file Arena.h.
Referenced by folly::Arena< Alloc >::allocateSlow(), folly::Arena< Alloc >::merge(), and folly::Arena< SysAllocator< void > >::totalSize().