class LowLevelAlloc
Defined at line 62 of file ../../third_party/abseil-cpp/absl/base/internal/low_level_alloc.h
Public Methods
void * Alloc (size_t request)
Returns a pointer to a block of at least "request" bytes
that have been newly allocated from the specific arena.
for Alloc() call the DefaultArena() is used.
Returns 0 if passed request==0.
Does not return 0 under other circumstances; it crashes if memory
is not available.
void * AllocWithArena (size_t request, Arena * arena)
void Free (void * s)
Deallocates a region of memory that was previously allocated with
Alloc(). Does nothing if passed 0. "s" must be either 0,
or must have been returned from a call to Alloc() and not yet passed to
Free() since that call to Alloc(). The space is returned to the arena
from which it was allocated.
Arena * NewArena (uint32_t flags)
Construct a new arena. The allocation of the underlying metadata honors
the provided flags. For example, the call NewArena(kAsyncSignalSafe)
is itself async-signal-safe, as well as generatating an arena that provides
async-signal-safe Alloc/Free.
bool DeleteArena (Arena * arena)
Destroys an arena allocated by NewArena and returns true,
provided no allocated blocks remain in the arena.
If allocated blocks remain in the arena, does nothing and
returns false.
It is illegal to attempt to destroy the DefaultArena().
Arena * DefaultArena ()
The default arena that always exists.
Enumerations
enum
| Name | Value |
|---|---|
| kCallMallocHook | 0x0001 |
| kAsyncSignalSafe | 0x0002 |
Create a new arena.
The root metadata for the new arena is allocated in the
meta_data_arena; the DefaultArena() can be passed for meta_data_arena.
These values may be ored into flags:
Defined at line 92 of file ../../third_party/abseil-cpp/absl/base/internal/low_level_alloc.h