Implement string space pool with compacting garbage collector

Replaces individual malloc/free string management with a contiguous pool
(default 32KB) and compacting GC, matching the original GW-BASIC's
GETSPA/GARBAG architecture. Allocation is a bump pointer; gw_str_free()
is a no-op (descriptors are nulled, data reclaimed by GC). Compaction
runs at statement boundaries when the pool drops below 4KB free, walking
the variable table and array storage to relocate live strings.

FRE() now returns actual free pool space. FRE("") triggers a GC pass
before reporting. CLEAR n sets the string space size.
This commit is contained in:
Eremey Valetov
2026-03-29 04:55:48 -04:00
parent 724f823536
commit eb32021c19
10 changed files with 201 additions and 10 deletions
+7
View File
@@ -0,0 +1,7 @@
INITIAL OK
ALLOC OK
GC RECLAIMED
CONCAT LEN= 50
POOL OK
CLEAR SIZE OK
ALL DONE