refactor: make interpreter portable with static pools and I/O hooks

Co-authored-by: aider (openrouter/moonshotai/kimi-k2.6) <aider@aider.chat>
This commit is contained in:
2026-05-03 22:35:21 +03:00
parent b115744991
commit f033187c6c
6 changed files with 145 additions and 153 deletions
-7
View File
@@ -1,13 +1,6 @@
#include "forth.h"
int main(void) {
// Allocate user memory
user_mem_size = 1024 * 1024; // 1 Mega cells
user_mem = calloc((size_t)user_mem_size, sizeof(Cell));
if (!user_mem) {
fprintf(stderr, "Failed to allocate user memory\n");
return 1;
}
here = user_mem;
// Hidden words first