add copying token value and add Boehm GC ready for runtime implimentation

This commit is contained in:
2025-05-29 00:40:11 +01:00
parent b82e351daf
commit 626445a906
7 changed files with 67 additions and 10 deletions

19
src/memory.h Normal file
View File

@@ -0,0 +1,19 @@
#ifndef ARGON_MEMORY_H
#define ARGON_MEMORY_H
#include <stddef.h> // for size_t
// GC-managed allocations
void* ar_alloc(size_t size);
void* ar_alloc_atomic(size_t size);
char* ar_strdup(const char* str);
// Optional: temporary/arena allocations (e.g., for parsing)
void* ar_temp_alloc(size_t size);
void ar_temp_free_all();
// Memory init/shutdown
void ar_memory_init();
void ar_memory_shutdown();
#endif // ARGON_MEMORY_H