Initial tricolor implementation

This commit is contained in:
2026-01-22 07:49:30 -08:00
parent 1a0906206a
commit 6cc85491cf
8 changed files with 68 additions and 39 deletions
+3 -4
View File
@@ -54,7 +54,7 @@ static ALWAYS_INLINE fixnum_t XFIXNUM(LispVal *val) {
}
static ALWAYS_INLINE LispVal *MAKE_FIXNUM(fixnum_t fn) {
return (LispVal *) ((fn << 2) | FIXNUM_TAG);
return (LispVal *) ((((uintptr_t) fn) << 2) | FIXNUM_TAG);
}
static ALWAYS_INLINE bool LISP_FLOAT_P(LispVal *val) {
@@ -133,9 +133,8 @@ static ALWAYS_INLINE bool OBJECT_STATIC_P(LispVal *val) {
}
static inline void MARK_OBJECT_ADDED(LispVal *val, LispVal *into) {
ObjectGCSet val_set = OBJECT_GET_GC_SET(val);
ObjectGCSet into_set = OBJECT_GET_GC_SET(into);
if (into_set == GC_BLACK && val_set == GC_WHITE) {
if ((!OBJECT_GC_SET_P(into, GC_WHITE) || OBJECT_STATIC_P(into))
&& OBJECT_GC_SET_P(val, GC_WHITE)) {
gc_move_to_set(val, GC_GREY);
}
}