Change to incremental GC

This commit is contained in:
2026-02-28 09:11:21 -08:00
parent a76e6a335d
commit 45f6d7a53d
8 changed files with 176 additions and 61 deletions
+4 -3
View File
@@ -37,8 +37,8 @@ static ALWAYS_INLINE uintptr_t EXTRACT_TAG(LispVal *val) {
#define LISP_OBJECT_TAG ((uintptr_t) 0)
// 0b01
#define FIXNUM_TAG ((uintptr_t) 1)
// 0b11
#define LISP_FLOAT_TAG ((uintptr_t) 3)
// 0b10
#define LISP_FLOAT_TAG ((uintptr_t) 2)
static ALWAYS_INLINE bool LISP_OBJECT_P(LispVal *val) {
return EXTRACT_TAG(val) == LISP_OBJECT_TAG;
@@ -76,7 +76,6 @@ static ALWAYS_INLINE LispVal *MAKE_LISP_FLOAT(lisp_float_t flt) {
// ###############
// # Other types #
// ###############
// Make sure this is kept up to date with byterun.h
typedef enum {
TYPE_FIXNUM = 0,
TYPE_FLOAT = 1,
@@ -95,6 +94,8 @@ typedef struct {
ObjectGCInfo gc;
} LispObject;
extern bool lisp_gc_on_alloc;
#define LISP_OBJECT_ALIGNMENT (1 << LISP_TAG_BITS)
LispVal *lisp_alloc_object_no_gc(size_t size, LispValType type);
LispVal *lisp_alloc_object(size_t size, LispValType type);