proxygen
|
#include <Arena.h>
Static Public Member Functions | |
static size_t | goodSize (const Alloc &, size_t size) |
Simple arena: allocate memory which gets freed when the arena gets destroyed.
The arena itself allocates memory using a custom allocator which conforms to the C++ concept Allocator.
http://en.cppreference.com/w/cpp/concept/Allocator
You may also specialize ArenaAllocatorTraits for your allocator type to provide:
size_t goodSize(const Allocator& alloc, size_t size) const; Return a size (>= the provided size) that is considered "good" for your allocator (for example, if your allocator allocates memory in 4MB chunks, size should be rounded up to 4MB). The provided value is guaranteed to be rounded up to a multiple of the maximum alignment required on your system; the returned value must be also.
An implementation that uses malloc() / free() is defined below, see SysArena.
By default, don't pad the given size.
|
inlinestatic |
Definition at line 219 of file Arena.h.
References folly::size().
Referenced by folly::Arena< Alloc >::Block::allocate().