template <size_t PersistSize, size_t ObjectSize>
class GPArena
Defined at line 148 of file ../../zircon/kernel/lib/fbl/include/fbl/gparena.h
Growable Persistent Arena (GPArena) is an arena that allows for fast allocation and
deallocation of a single kind of object. Compared to other arena style allocators it
additionally guarantees that a portion of the objects memory will be preserved between calls to
Free+Alloc.
Public Methods
void GPArena<PersistSize, ObjectSize> ()
Defined at line 150 of file ../../zircon/kernel/lib/fbl/include/fbl/gparena.h
void ~GPArena<PersistSize, ObjectSize> ()
Defined at line 151 of file ../../zircon/kernel/lib/fbl/include/fbl/gparena.h
size_t MaxCount ()
The maximum number of objects that an arena can hold.
Defined at line 166 of file ../../zircon/kernel/lib/fbl/include/fbl/gparena.h
zx_status_t Init (const char * name, size_t max_count)
Reserves space for at least |max_count| objects, or more if they fit in the space left over
from rounding up to a whole number of pages. Fails with ZX_ERR_OUT_OF_RANGE if that would be
more than MaxCount() objects.
Defined at line 171 of file ../../zircon/kernel/lib/fbl/include/fbl/gparena.h
void * Alloc ()
Returns a raw pointer and not a reference to an object of type T so that the memory can be
inspected prior to construction taking place.
Defined at line 252 of file ../../zircon/kernel/lib/fbl/include/fbl/gparena.h
void Free (void * node)
Takes a raw pointer as the destructor is expected to have already been run.
Defined at line 279 of file ../../zircon/kernel/lib/fbl/include/fbl/gparena.h
size_t DiagnosticCount ()
Defined at line 284 of file ../../zircon/kernel/lib/fbl/include/fbl/gparena.h
bool Committed (void * node)
Defined at line 286 of file ../../zircon/kernel/lib/fbl/include/fbl/gparena.h
uintptr_t Confine (uintptr_t address)
Return |address| if it is within the valid range of the arena or the base of the arena if
not. Hardened against Spectre V1 / bounds check bypass speculation attacks - it always
returns a safe value, even under speculation.
Defined at line 294 of file ../../zircon/kernel/lib/fbl/include/fbl/gparena.h
void * Base ()
Defined at line 301 of file ../../zircon/kernel/lib/fbl/include/fbl/gparena.h
void Dump ()
Defined at line 303 of file ../../zircon/kernel/lib/fbl/include/fbl/gparena.h