diff options
| author | eunhhu <[email protected]> | 2026-10-06 03:46:11 +0100 |
|---|---|---|
| committer | eunhhu <[email protected]> | 2026-10-06 03:46:11 +0100 |
| commit | e1c8812473c89b96e9c1a09f3a46f8f392945b64 (patch) | |
| tree | 69d15026709b48933c9f2aa282f40de6624ba12e /cli | |
| parent | 1b64ab89710a637e66604ece15d83f40ba314586 (diff) | |
| download | pure-e1c8812473c89b96e9c1a09f3a46f8f392945b64.tar.gz pure-e1c8812473c89b96e9c1a09f3a46f8f392945b64.zip | |
JIT: an append to a HASHED list in a nest whose books keep DENSE appends' growth in registers checks the memory against the books' headroom (the app's growth lacks theirs until written back): it faulted MEMORY a round late, its work a round more than the executor's (a loop appending to DENSE, FLAT and HASHED lists, memory 6000: 3562 for 3525). pure-run: memory N, the states' budget
Diffstat (limited to 'cli')
| -rw-r--r-- | cli/pure-run.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/cli/pure-run.c b/cli/pure-run.c index 8ef91d9..e62bc98 100644 --- a/cli/pure-run.c +++ b/cli/pure-run.c @@ -12,6 +12,7 @@ * saved at the end of input or by save. --batch N defers saving and saves * every N commands (and at the end), so N events share one commit. * down NAME | up NAME | frame [N] | type NAME HEX|- | message NAME HEX|- | tick NAME | time MS | replace PATH | save | show + * budget N (the work an event may do) | memory N (what the states may hold) | work (the last event's work) * (type gives a text input its bytes, message a message input its payload, laid out as the module says.) * Text states and text views print as JSON strings; cursors as byte positions; * lists as arrays of objects; indices as positions; a table view as an array @@ -201,6 +202,11 @@ int main(int argc, char **argv) { unsigned long long budget = strtoull(argument, &end, 10); if (!*argument || *end) failure = "budget"; else pure_app_work(&app, budget); + } else if (!strcmp(command, "memory")) { /* what the states may hold (0: no budget) */ + char *end; + unsigned long long bytes = strtoull(argument, &end, 10); + if (!*argument || *end) failure = "memory"; + else pure_app_memory(&app, (size_t)bytes); } else if (!strcmp(command, "work")) printf("{\"work\":%llu}\n", (unsigned long long)app.work); /* the last event's */ else if (strcmp(command, "show")) failure = "unknown command"; if (batch && strcmp(command, "show") && ++unsaved == batch) { |
