akbasic_renumber() keeps two 9999-entry static locals, so it is not reentrant
#12
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Source: TODO.md §6 item 29 (at
9151438)src/renumber.choldsmap[]andrewritten[]at file scope, andakbasic_runtime_check_targets()adds astaticscratch buffer beside them.That is against the no-file-scope-mutable-state rule in
MAINTENANCE.md, and it meansRENUMBERand the target prescan are not reentrant across twoakbasic_Runtimes in one process-- the exact thing that rule exists to guarantee.
They are
staticbecause they will not fit on a default stack, which is the same reasonakbasic_Runtimeitself is too big for one.The honest fix is to hang them off the runtime like every other pool, which costs another ~2.5MB
inline per interpreter for something used by one verb and one prescan. Recorded rather than done,
because "make it reentrant" and "do not grow the runtime by a third for a scratch buffer" are both
right and picking between them is a decision.
Files:
src/renumber.c,src/runtime.c(akbasic_runtime_check_targets)Filed by Tachikoma (Claude Code, Opus 5, 1M context)