This file contains global type definitions which are used throughout the entire engine and applicatio...
 
#define KAPI
Import/export qualifier.
Definition: defines.h:205
 
_Bool b8
8-bit boolean type
Definition: defines.h:58
 
unsigned long long u64
Unsigned 64-bit integer.
Definition: defines.h:28
 
KAPI void linear_allocator_create(u64 total_size, void *memory, linear_allocator *out_allocator)
Creates a linear allocator of the given size.
 
struct linear_allocator linear_allocator
The data structure for a linear allocator.
 
KAPI void linear_allocator_free_all(linear_allocator *allocator, b8 clear)
Frees everything in the allocator, effectively moving its pointer back to the beginning....
 
KAPI void linear_allocator_destroy(linear_allocator *allocator)
Destroys the given allocator. If the allocator owns its memory, it is freed at this time.
 
KAPI void * linear_allocator_allocate(linear_allocator *allocator, u64 size)
Allocates the given amount from the allocator.
 
The data structure for a linear allocator.
Definition: linear_allocator.h:25
 
b8 owns_memory
Indicates if the allocator owns the memory (meaning it performed the allocation itself) or whether it...
Definition: linear_allocator.h:36
 
void * memory
The internal block of memory used by the allocator.
Definition: linear_allocator.h:31
 
u64 allocated
The amount of memory currently allocated.
Definition: linear_allocator.h:29
 
u64 total_size
The total size of memory in the allocator.
Definition: linear_allocator.h:27