Commit e11dc6dc

e11dc6dc0b00Merged

Yukihiro "Matz" Matsumoto <[email protected]> · 5 months ago · 4 files · +2 added · ~2 modified

Description

Build the mark/sweep collector body as a libspinel_rt.a unit

The collector's non-inline machinery (sp_gc_mark, sp_gc_mark_all, sp_gc_collect, the SPINEL_MAX_HEAP_MB governor, the SPINEL_GC_VERIFY support, sp_oom_die) lives in lib/sp_gc.c. lib/sp_gc.h carries the shared surface: sp_RbVal, the collector globals touched by both sides (extern), and the hot inline mark helpers (sp_mark_string / sp_mark_rbval / sp_gc_mark_root_entry) so the per-object mark path stays inlined in the generated TU. sp_gc_alloc and the SP_GC_ROOT machinery stay in the generated TU; sp_str_sweep / sp_re_mark_globals carry external linkage so the collector body reaches them.

Self-host fixpoint holds; 854 tests pass; optcarrot checksum 59662 (fps unchanged ~520-540); bench green.

Co-Authored-By: Claude Opus 4.8 [email protected]

Details

Commit
e11dc6dc0b00
Parent
f6740a77ae30

MakefilemodifiedView file

@@ -331,13 +331,17 @@
331331 @mkdir -p build
332332 $(CC) -c -O2 -Wno-all $(SEC_FLAGS) -Ilib lib/sp_system.c -o build/sp_system.o
333333
334+build/sp_gc.o: lib/sp_gc.c lib/sp_gc.h lib/sp_types.h
335+ @mkdir -p build
336+ $(CC) -c -O2 -Wno-all $(SEC_FLAGS) -Ilib lib/sp_gc.c -o build/sp_gc.o
337+
334338 build/sp_net.o: lib/sp_net.c lib/sp_net.h
335339 @mkdir -p build
336340 $(CC) -c -O2 -Wno-all $(SEC_FLAGS) -Ilib lib/sp_net.c -o build/sp_net.o
337341
338342 SP_RT_LIB = lib/libspinel_rt.a
339343
340-$(SP_RT_LIB): $(RE_OBJ) build/sp_bigint.o build/sp_crypto.o build/sp_pack.o build/sp_strscan.o build/sp_time.o build/sp_core.o build/sp_net.o build/sp_system.o
344+$(SP_RT_LIB): $(RE_OBJ) build/sp_bigint.o build/sp_crypto.o build/sp_pack.o build/sp_strscan.o build/sp_time.o build/sp_core.o build/sp_net.o build/sp_system.o build/sp_gc.o
341345 ar rcs $@ $^
342346
343347 regexp: $(SP_RT_LIB)
@@ -811,6 +815,7 @@
811815 install -m 644 lib/sp_types.h $(SPNLDIR)/lib/
812816 install -m 644 lib/sp_core.h $(SPNLDIR)/lib/
813817 install -m 644 lib/sp_system.h $(SPNLDIR)/lib/
818+ install -m 644 lib/sp_gc.h $(SPNLDIR)/lib/
814819 install -m 644 lib/sp_time.h $(SPNLDIR)/lib/
815820 install -m 644 lib/sp_net.h $(SPNLDIR)/lib/
816821 install -m 644 lib/*.rb $(SPNLDIR)/lib/