diff options
Diffstat (limited to 'docs/design/memory.md')
| -rw-r--r-- | docs/design/memory.md | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/docs/design/memory.md b/docs/design/memory.md index c282df5..8875c72 100644 --- a/docs/design/memory.md +++ b/docs/design/memory.md @@ -5,12 +5,12 @@ the compiler, runtime, and host must agree on their addresses. `genmap` writes a matching `memmap.h`, runtime source, and compiler source; `src/tools/automap.sh` builds an image against those files. rebuild the host against the generated headers. changing a header alone does not relocate an existing genome. compact compiler and run-only maps also put their heap above the fixed regions, so compiler storage can grow after startup. ```sh -bin/genmap --preset default --check +build/bin/genmap --preset default --check bash src/tools/automap.sh small build/small -bin/genmap --preset default --code 65536 --symbols 256 --locals 64 --fwd 512 --pool 8192 --hash 1024 -o build/custom +build/bin/genmap --preset default --code 65536 --symbols 256 --locals 64 --fwd 512 --pool 8192 --hash 1024 -o build/custom ``` -run `bin/genmap --help` for the table, heap, genome, and stack options. sizes are in vm words unless an option says otherwise; one word is eight bytes. `--snap-cap` selects the initial snapshot reservation and `--quote-cap` selects an initial token count, with three words per token. both regions grow after startup. +run `build/bin/genmap --help` for the table, heap, genome, and stack options. sizes are in vm words unless an option says otherwise; one word is eight bytes. `--snap-cap` selects the initial snapshot reservation and `--quote-cap` selects an initial token count, with three words per token. both regions grow after startup. ## layout inventory @@ -79,8 +79,8 @@ the stub and board ports reserve `MICRO_PORT_WORDS` cells at build time; it defa the default native map places a growing heap above the fixed regions. hosted runners accept `TINYVM_MEMORY_WORDS` for initial memory and `TINYVM_MAX_MEMORY_WORDS` for its growth limit. javascript also accepts `memoryWords` and `maxMemoryWords` when constructing a vm. invalid configurations are rejected before execution. ```sh -TINYVM_MAX_MEMORY_WORDS=16777216 bin/zy < examples/hello.zc -TINYVM_MEMORY_WORDS=4194304 bin/zym < examples/hello.zc +TINYVM_MAX_MEMORY_WORDS=16777216 build/bin/zy < examples/hello.zc +TINYVM_MEMORY_WORDS=4194304 build/bin/zym < examples/hello.zc ``` the native core reserves a stable backing allocation up to its startup maximum; increasing the available size keeps addresses and native code pointers valid. the microcore and javascript vm replace backing allocations when they grow, preserving existing contents. native bounds use the reservation; portable bounds use the current allocation. memory syscall `9` with argument `4` requests growth, and argument `5` changes the growth limit during execution. a limit cannot fall below the current size. the native limit cannot exceed its startup reservation. |
