|
rlib
Convenience library for useful things
|
Concrete layout of an RMemAllocator.
More...
#include <rlib/rmemallocator.h>
Data Fields | |
| RRef | ref |
| const rchar * | mem_type |
| rsize | alignmask |
| RMem *(* | alloc )(RMemAllocator *allocator, rsize size, const RMemAllocationParams *params) |
| rboolean(* | free )(RMemAllocator *allocator, RMem *mem) |
| rpointer(* | map )(RMem *mem, const RMemMapInfo *info) |
| rboolean(* | unmap )(RMem *mem, const RMemMapInfo *info) |
| RMem *(* | merge )(const RMemAllocationParams *params, RMem **mems, ruint count) |
| RMem *(* | copy )(RMem *mem, rssize offset, rssize size) |
| RMem *(* | view )(RMem *mem, rssize offset, rssize size) |
Concrete layout of an RMemAllocator.
Opaque handle to an allocator backend.
Allocator implementations fill in the mem_type / alignmask fields and the seven vtable slots. Client code treats the struct as opaque and goes through the helpers above.
| rsize RMemAllocator::alignmask |
Native alignment guarantee of this allocator.
| RMem *(* RMemAllocator::alloc) (RMemAllocator *allocator, rsize size, const RMemAllocationParams *params) |
Produce a new chunk.
| rboolean(* RMemAllocator::free) (RMemAllocator *allocator, RMem *mem) |
Release a chunk's backing storage.
| rpointer(* RMemAllocator::map) (RMem *mem, const RMemMapInfo *info) |
Acquire a data pointer for r_mem_map.
| const rchar* RMemAllocator::mem_type |
Registry name (e.g. R_MEM_ALLOCATOR_SYSTEM).
| RMem *(* RMemAllocator::merge) (const RMemAllocationParams *params, RMem **mems, ruint count) |
Concatenate mems into a fresh chunk.
| RRef RMemAllocator::ref |
Refcount base.
| rboolean(* RMemAllocator::unmap) (RMem *mem, const RMemMapInfo *info) |
Release the data pointer for r_mem_unmap.