fix delete gc bug

This commit is contained in:
2026-02-13 21:52:37 -06:00
parent 83263379bd
commit f49ca530bb
13 changed files with 11511 additions and 11494 deletions

View File

@@ -845,6 +845,18 @@ static inline objhdr_t *chase(JSValue v) {
return oh;
}
/* Resolve a forward pointer in-place. After rec_resize the old record
gets a forward header; any JSValue slot still pointing at it must be
updated to follow the chain to the live copy. */
static inline void mach_resolve_forward(JSValue *slot) {
if (JS_IsPtr(*slot)) {
objhdr_t h = *(objhdr_t *)JS_VALUE_GET_PTR(*slot);
if (objhdr_type(h) == OBJ_FORWARD) {
*slot = JS_MKPTR(objhdr_fwd_ptr(h));
}
}
}
/* Inline type checks — use these in the VM dispatch loop to avoid
function call overhead. The public API (JS_IsArray etc. in quickjs.h)
remains non-inline for external callers; those wrappers live in runtime.c. */