From 4ff9e3b89fa1dca5d5981a22e5d41ac5f36ad11d Mon Sep 17 00:00:00 2001 From: zinc Date: Thu, 15 Oct 2026 02:34:57 +0330 Subject: genmap: default genome reservation 0x70000 words (the genome had 197 words left); the map constants in rt.zc and the README table move by 0x8000; gc.zc's reclaim bound is 900 (937 with the heap higher, 952 before) and the run-only section rewrites whatever its number --- tests/programs/gc.zc | 2 +- tests/test.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/programs/gc.zc b/tests/programs/gc.zc index 44fde5d..00586d7 100644 --- a/tests/programs/gc.zc +++ b/tests/programs/gc.zc @@ -12,7 +12,7 @@ fn main() { churn(1000); rt.put_n(rt.live_objects() - base); rt.put_c(' '); f = rt.gc(); - rt.put_n(f >= 950); rt.put_c(' '); // conservative: stale words, and genome code words that happen to look like heap addresses, keep a few alive + rt.put_n(f >= 900); rt.put_c(' '); // conservative: stale words, and genome code words that happen to look like heap addresses, keep a few alive (937 with the genome at 0x70000 words) rt.put_n(keep[0]); rt.put_c(' '); // the one a global still points at survives churn(200000); // 3.2m words through a 393k word heap: needs the automatic collector rt.put_n(rt.gc_runs > 1); rt.put_c(' '); diff --git a/tests/test.sh b/tests/test.sh index a3370f2..e93472c 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -371,7 +371,7 @@ s_runonly() { runonly() { # $1 label, $2 source. the program is already in the image, so it reads no source. # the map is sized to the program: src/tools/automap.sh lays it out for the image's own length local a b d=$T/run-$1 input=$2 - if [ "$1" = gc ]; then input=$T/collector-progress.zc; sed 's/f >= 950/f > 0/' "$2" > "$input"; fi + if [ "$1" = gc ]; then input=$T/collector-progress.zc; sed -E 's/f >= [0-9]+/f > 0/' "$2" > "$input"; fi GENMAP=$T/genmap bash src/tools/automap.sh run $d src/runtime/run.zc "$input" >/dev/null || { chk 0 1 "run $1 builds"; return; } cp src/micro/micro.c src/micro/micro_port.h src/micro/port_linux.c src/micro/port_stub.c src/core/fops.h src/core/bops.h src/core/stack.h src/core/genome.h $d/ $CC -pthread -DZY_THREADS -O2 -w -fwrapv $d/micro.c $d/port_linux.c -o $T/zymr || { chk 0 1 "run $1 links"; return; } -- cgit v1.2.3