diff options
| author | 2026-10-15 02:34:57 +0330 | |
|---|---|---|
| committer | 2026-10-15 02:40:51 +0330 | |
| commit | 4ff9e3b89fa1dca5d5981a22e5d41ac5f36ad11d (patch) | |
| tree | 9bfe048a3719072864713c0d561ad3ce970ab25c | |
| parent | merge work/triage: zc0typed.zc without .u on a typed parameter; a //:lines ma... (diff) | |
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
| -rw-r--r-- | README.md | 12 | ||||
| -rw-r--r-- | src/runtime/rt.zc | 18 | ||||
| -rw-r--r-- | src/tools/genmap.c | 2 | ||||
| -rw-r--r-- | tests/programs/gc.zc | 2 | ||||
| -rwxr-xr-x | tests/test.sh | 2 |
5 files changed, 18 insertions, 18 deletions
@@ -574,12 +574,12 @@ the initial layout reserves code, compiler tables, the genome, and stacks below 0x080000..0x08FFFF type records (65536 words) 0x090000 frame pointer word (ZFP); 0x090002 is the syscall gate 0x090100..0x113FFF compiler data: interned names, symbol table (16384), locals, fixups, tables -0x114100..0x17C0FF genome: 0x114100 entry, then the symbol table address and the image end (425984 words reserved) -0x17C100..0x1BC0FF frame stack, grows down from 0x1BC100 (262144 words) -0x1BC100..0x1CC0FF return stack, grows up -0x1CC100..0x1D40FF mark stack -0x1D4100..0x1DCFF0 data stack, grows down -0x1DD000..0x23CFFF the heap to start with (0x60000 words), then it grows up to MW +0x114100..0x1840FF genome: 0x114100 entry, then the symbol table address and the image end (458752 words reserved) +0x184100..0x1C40FF frame stack, grows down from 0x1C4100 (262144 words) +0x1C4100..0x1D40FF return stack, grows up +0x1D4100..0x1DC0FF mark stack +0x1DC100..0x1E4FF0 data stack, grows down +0x1E5000..0x244FFF the heap to start with (0x60000 words), then it grows up to MW ``` the numbers describe the default build's initial reservations. compact compiler and run-only maps start with smaller reservations and also support growth. `build/bin/genmap` writes matching layouts (see "smaller machines"); `--preset fixed` retains the older bounded heap for compatibility. the host answers `core.syscall(9, k)` with facts about the map (0 total words, 1 heap start, 2 heap end for now, 3 bytes). argument 4 requests memory growth, and argument 5 changes the growth limit within the host's backing constraints. diff --git a/src/runtime/rt.zc b/src/runtime/rt.zc index 968be87..099ca2e 100644 --- a/src/runtime/rt.zc +++ b/src/runtime/rt.zc @@ -37,20 +37,20 @@ unbounded; // across targets and image sizes. // @map-rt -const MW = 0x1DD000; +const MW = 0x1E5000; const CODE_END = 0x80000; -const HEAP_LO = 0x1DD000; -const HEAP_HI = 0x23D000; +const HEAP_LO = 0x1E5000; +const HEAP_HI = 0x245000; const HEAP_GROW = 0x1; const ZFP = 0x90000; const GORG = 0x114100; -const FBOT = 0x17C100; -const FTOP = 0x1BC100; -const RS0 = 0x1BC100; -const MARK0 = 0x1CC100; +const FBOT = 0x184100; +const FTOP = 0x1C4100; +const RS0 = 0x1C4100; +const MARK0 = 0x1D4100; const MARKN = 0x8000; -const DSLO = 0x1D4100; -const DSHI = 0x1DCFF0; +const DSLO = 0x1DC100; +const DSHI = 0x1E4FF0; const MAGIC = 0x2B7E1516; // @end-map diff --git a/src/tools/genmap.c b/src/tools/genmap.c index 6d8db55..519852b 100644 --- a/src/tools/genmap.c +++ b/src/tools/genmap.c @@ -242,7 +242,7 @@ static void preset_default(Spec *s) s->compiler = 1; s->heap_top = 1; s->code_end = 0x80000; s->types = 65536; s->heap = 0x60000; s->total = 0x8000000; - s->genome = 0x68000; s->frame = 0x40000; s->ret = 0x10000; s->mark = 0x8000; + s->genome = 0x70000; s->frame = 0x40000; s->ret = 0x10000; s->mark = 0x8000; s->data = 0x7FF0; tables_big(s); } 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; } |
