10#ifndef NAME_ARENA_SIZE
11#define NAME_ARENA_SIZE 0x10000
26 map_init_ty(
const char *, &
_name_map, alloc);
39 "Name list must be unlocked to add new name `%s`", str);
44 char *str_copy = allocator_alloc_copy_ty(
char, alloc, str, strlen(str) + 1);
#define ASSERT(expr, msg,...)
Definition defs.h:35
uint64_t u64
Definition defs.h:46
#define list_init_ty(ty, ls, alloc)
Definition list.h:36
#define list_get_ty(ty, ls, idx)
Definition list.h:130
static void list_cleanup(list_t *ls)
Definition list.h:166
static void list_push(list_t *ls, const void *data)
Definition list.h:72
#define map_get_ty(ty, map, key)
Returns a typed pointer to a member at key key. Returns NULL if the key is not present.
Definition map.h:218
#define map_insert_ty(ty, map, key, data)
Definition map.h:196
static allocator_t allocator_new_malloc()
Wrap malloc into an generic allocator interface.
Definition memory.h:99
static name_t as_name(const char *str)
Definition names.h:33
static void names_lock()
Definition names.h:31
static void names_init()
Definition names.h:21
static map_t _name_map
Definition names.h:18
static const char * name_as_str(name_t name)
Definition names.h:51
u64 name_t
Definition names.h:14
static list_t _name_list
Definition names.h:17
static arena_t _name_arena
Definition names.h:16
static bool _name_list_is_locked
Definition names.h:19
#define NAME_ARENA_SIZE
Definition names.h:11
static void names_cleanup()
Definition names.h:55
A generic allocator type passed by value. Contains a fallback allocator and a set of function pointer...
Definition memory.h:30
The Arena allocator is a single continous block of memory.
Definition arena.h:17
sz size
Definition list.h:17