|
ATLAS Offline Software
|
Go to the documentation of this file.
13 #ifndef ATLALLOCATORS_ARENABLOCK_H
14 #define ATLALLOCATORS_ARENABLOCK_H
25 class ArenaAllocatorBase;
254 static const int ArenaBlockBodyOffset =
264 #endif // not ATLALLOCATORS_ARENABLOCK_H
void func_t(pointer)
Function that operates on an element.
const ArenaBlock * link() const
Return the link pointer of the block.
pointer index(size_t i)
Return a pointer to element i in the block.
ArenaBlock(size_t n, size_t elt_size)
Prohibit calling these.
void unprotect()
Write-enable this block.
static void destroy(ArenaBlock *p, func_t *dtor)
Destroy a block.
ArenaBlock(const ArenaBlock &)
std::string tail(std::string s, const std::string &pattern)
tail of a string
static void applyList(ArenaBlock *p, func_t *func, size_t n)
Call a function on elements in a list of blocks.
static size_t overhead()
Return the per-block memory overhead, in bytes.
size_t eltSize() const
Return the size of the elements in the block.
static ArenaBlock * newBlock(size_t n, size_t elt_size, func_t *ctor)
Create a new block.
static void appendList(ArenaBlock **headp, ArenaBlock *tail)
Concatenate two lists of blocks.
static void unprotectList(ArenaBlock *p)
Write-enable all blocks in a list.
const_pointer index(size_t i) const
Return a pointer to element i in the block.
static size_t nactive()
Return the global number of blocks in use.
ArenaBlock *& link()
Return the link pointer of the block.
char * pointer
Type for a pointer to an element.
ArenaBlockAlignDetail::padForAlign m_dummy
size_t size() const
Return the number of elements in the block.
size_t m_size
Number of elements in this block.
Common base class for arena allocator classes.
pointer index(size_t i, size_t elt_size)
Return a pointer to element i in the block.
ArenaBlock * m_link
The link for the linked list.
const_pointer index(size_t i, size_t elt_size) const
Return a pointer to element i in the block.
A large memory block that gets carved into smaller uniform elements.
static std::atomic< size_t > s_nactive
Global count of the number of blocks in use.
size_t m_elt_size
Size, in bytes, of each element in this block.
const char * const_pointer
static void protectList(ArenaBlock *p)
Write-protect all blocks in a list.
void protect()
Write-protect this block.
static void destroyList(ArenaBlock *p, func_t *dtor)
Destroy all blocks in a list.
A dummy pad struct to put at the end of the ArenaBlock header to ensure the alignment of the elements...
ArenaBlock & operator=(const ArenaBlock &)