move to meson for build system

This commit is contained in:
Lobo 2026-01-19 10:25:56 -03:00
parent fdd1ee61b5
commit 9616fb616e
28 changed files with 123 additions and 24 deletions

31
src/gc.h Normal file
View file

@ -0,0 +1,31 @@
#ifndef GC_H
#define GC_H
#include "common.h"
#include "object.h"
#define GC_DEBUG 1
#define HEAP_BYTES (4 * 1024 * 1024)
typedef struct Gs {
U8 *start, *end;
U8 *free;
} Gs;
typedef struct Gc {
Gs from, to;
struct {
O **items;
Z count, capacity;
} roots;
} Gc;
V gc_addroot(Gc *, O *);
I gc_mark(Gc *);
V gc_reset(Gc *, I);
V gc_collect(Gc *);
Hd *gc_alloc(Gc *, Z);
V gc_init(Gc *);
V gc_deinit(Gc *);
#endif