function void mem_free_all(MemAllocator *alloc)
Clears the entire allocator in one shot (e.g. arena reset, pool reset).
void mem_arena_release(MemArena *arena)
Returns all virtual memory back to the operating system.
struct MemAllocator mem_arena_allocator(MemArena *arena)
Wraps a MemArena in the generic MemAllocator interface.
MemArena mem_arena_create(usize reserve_size)
Initializes a new virtual memory Arena.
static void sb_append_cstr(StringBuilder *sb, MemAllocator *alloc, const char *cstr)
Appends a null-terminated C string to the builder.
static void sb_reset(StringBuilder *sb)
Resets the builder to empty without touching the allocator.
static void sb_append(StringBuilder *sb, MemAllocator *alloc, String8 str)
Appends a String8 slice to the builder.
static String8 sb_join(StringBuilder *sb, MemAllocator *out_alloc)
Materializes all appended segments into a single contiguous String8.
static void sb_append_fmt(StringBuilder *sb, MemAllocator *alloc, const char *fmt,...)
Appends a printf-style formatted string to the builder.
static b32 str8_match(String8 a, String8 b)
Returns 1 if a and b contain identical bytes (case-sensitive).
#define STR8(s)
Wraps a C string literal into a String8 at compile time.
Generic interface for abstracting memory allocators.
High-performance virtual memory Arena Allocator.
Allocator-agnostic StringBuilder for efficient string concatenation.
An abstract allocator interface.
A virtual memory-backed linear allocator.
A sized UTF-8 string slice.
An allocator-agnostic string builder.
Single-header testing framework with pretty-printed output.
#define EXPECT(cond)
Evaluates a condition. Records and counts the failure if false.
#define TEST_CASE(name)
Declares a test case function.
#define EXPECT_FATAL(cond)
Like EXPECT but aborts immediately on failure.