Memory
Source: std/mem.mw.
Thin, stable names over the allocator in heap.mw and the primitives in raw.mw. Every allocating function has a matching free.
Thin, stable names over the libc-free allocator (std/heap.mw) and the memory primitives (std/raw.mw).
struct Arena { buffer: *u8; capacity: i64; offset: i64;}Functions
Section titled “Functions”fn alloc(size: i64) -> *u8realloc
Section titled “realloc”fn realloc(ptr: *u8, new_size: i64) -> *u8dealloc
Section titled “dealloc”fn dealloc(ptr: *u8)mem_copy
Section titled “mem_copy”fn mem_copy(dest: *u8, src: *u8, count: i64)mem_zero
Section titled “mem_zero”fn mem_zero(dest: *u8, count: i64)arena_new
Section titled “arena_new”fn arena_new(capacity: i64) -> *Arenaarena_alloc
Section titled “arena_alloc”fn arena_alloc(a: *Arena, size: i64) -> *u8arena_reset
Section titled “arena_reset”fn arena_reset(a: *Arena)arena_free
Section titled “arena_free”fn arena_free(a: *Arena)