Anklang C++ API 0.0.0
Loading...
Searching...
No Matches
LoftBuckets

Public Member Functions

size_tcount (unsigned bucket_index, const ArenaList &arenas)
LoftPtr< void >do_alloc (size_t size, size_t align)
voiddo_free (void *mem, size_t size)
LoftBuckets (BumpAllocator &bumpallocator)

Public Attributes

BumpAllocator &bump_allocator

Detailed Description

Lock-free, obstruction-free, non-coalescing, alloc-only bucket allocator

Loft is a simple lock-free bucket allocator that maintains free-lists without coalescing blocks or releasing memory back to the underlying bump allocator. The free-list buckets are 64 bytes apart and all allocations are 64 byte aligned to avoid false sharing of cache lines. Allocation requests are satisfied with O(1) complexity using lock-free code paths. Because memory is not released back, no block coalescing (or splitting) is implemented.

Constructor & Destructor Documentation

LoftBuckets()

LoftBuckets ( BumpAllocator & bumpallocator)
explicit

Member Function Documentation

do_alloc()

LoftPtr< void > do_alloc ( size_t size,
size_t align
)

do_free()

void do_free ( void * mem,
size_t size
)

count()

size_t count ( unsigned bucket_index,
const ArenaList & arenas
)

Member Data Documentation

bump_allocator

BumpAllocator& bump_allocator