add identifier to parser

This commit is contained in:
2025-06-01 02:28:27 +01:00
parent b7e9493171
commit d2518afb8e
20 changed files with 733 additions and 251 deletions

View File

@@ -1,23 +1,17 @@
#include "memory.h"
#include <gc.h>
#include <string.h>
#include <stdlib.h> // for malloc/free (temp arena fallback)
#include <string.h>
void ar_memory_init() {
GC_INIT();
}
void ar_memory_init() { GC_INIT(); }
void* ar_alloc(size_t size) {
return GC_MALLOC(size);
}
void *ar_alloc(size_t size) { return GC_MALLOC(size); }
void* ar_alloc_atomic(size_t size) {
return GC_MALLOC_ATOMIC(size);
}
void *ar_alloc_atomic(size_t size) { return GC_MALLOC_ATOMIC(size); }
char* ar_strdup(const char* str) {
size_t len = strlen(str) + 1;
char* copy = (char*)GC_MALLOC(len);
memcpy(copy, str, len);
return copy;
char *ar_strdup(const char *str) {
size_t len = strlen(str) + 1;
char *copy = (char *)GC_MALLOC(len);
memcpy(copy, str, len);
return copy;
}