|
libcute 0.1
|
#include <stddef.h>#include "io/error.h"#include "nostd.h"#include "utility.h"

Go to the source code of this file.
Classes | |
| struct | cu_Allocator |
Typedefs | |
| typedef cu_IoSlice_Result(* | cu_Allocator_AllocFunc) (void *self, cu_Layout layout) |
| typedef cu_IoSlice_Result(* | cu_Allocator_GrowFunc) (void *self, cu_Slice old_mem, cu_Layout new_layout) |
| typedef cu_IoSlice_Result(* | cu_Allocator_ShrinkFunc) (void *self, cu_Slice old_mem, cu_Layout new_layout) |
| typedef void(* | cu_Allocator_FreeFunc) (void *self, cu_Slice mem) |
Functions | |
| cu_Allocator | cu_Allocator_CAllocator (void) |
| cu_Allocator | cu_Allocator_NullAllocator (void) |
Generic allocator interface.
| typedef cu_IoSlice_Result(* cu_Allocator_AllocFunc) (void *self, cu_Layout layout) |
Allocation function signature.
| typedef void(* cu_Allocator_FreeFunc) (void *self, cu_Slice mem) |
Free function signature.
| typedef cu_IoSlice_Result(* cu_Allocator_GrowFunc) (void *self, cu_Slice old_mem, cu_Layout new_layout) |
Grow function signature.
| typedef cu_IoSlice_Result(* cu_Allocator_ShrinkFunc) (void *self, cu_Slice old_mem, cu_Layout new_layout) |
Shrink function signature.
| cu_Allocator cu_Allocator_CAllocator | ( | void | ) |
System allocator backed by libc malloc/free.


| cu_Allocator cu_Allocator_NullAllocator | ( | void | ) |
Allocator that always fails with out-of-memory errors.

