12 #ifndef ROC_CORE_HEAP_ARENA_H_
13 #define ROC_CORE_HEAP_ARENA_H_
114 static size_t guards_;
Heap arena implementation.
virtual void deallocate(void *ptr)
Deallocate previously allocated memory.
size_t num_guard_failures() const
Get number of guard failures.
virtual void * allocate(size_t size)
Allocate memory.
size_t num_allocations() const
Get number of allocated blocks.
static void set_guards(size_t guards)
Set enabled guards, for all instances. Parameters.
virtual size_t compute_allocated_size(size_t size) const
Computes how many bytes will be actually allocated if allocate() is called with given size....
virtual size_t allocated_size(void *ptr) const
Returns how many bytes was allocated for given pointer returned by allocate(). Covers all internal ov...
Base class for non-copyable objects.
HeapArenaGuard
Heap arena guards.
@ HeapArena_LeakGuard
Panic if leaks detected in arena destructor.
@ HeapArena_OverflowGuard
Panic if detected buffer overflow when deallocating chunk.
@ HeapArena_OwnershipGuard
Panic if detected ownership mismatch when deallocating chunk.
Maximum aligned data unit.