From 751799352cbb35ba746dc664059947ea1db66bc4 Mon Sep 17 00:00:00 2001 From: David Schmenk Date: Sun, 14 Jan 2024 17:54:17 -0800 Subject: [PATCH] FORTH and JIT compiler fighting over memory above heapmark for temp buffer space Have FORTH trya nd reserve space for temp string and PAD away from potential JIT interference --- src/toolsrc/plforth.pla | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/toolsrc/plforth.pla b/src/toolsrc/plforth.pla index c413195..665d703 100644 --- a/src/toolsrc/plforth.pla +++ b/src/toolsrc/plforth.pla @@ -15,6 +15,7 @@ byte srclevel = 0 // // Internal buffers // +word strbuf, padbuf res[SRCREFS * INBUF_SIZE] inbuf res[t_except] exitforth // @@ -1165,7 +1166,7 @@ def _fill_(a,b,c)#0 memset(a, c | (c << 8), b) end def _pad_#1 - return heapmark + 128 + return padbuf end def _trailing_(a,b)#2 while b and ^(a + b - 1) == ' ' @@ -1639,8 +1640,8 @@ def _str_#0 _compword_(@d_slit) memcpy(heapalloc(len), str, len) // Add to dictionary else - (@push)(heapmark)#0 - memcpy(heapmark, str, len) // Copy to HERE + (@push)(strbuf)#0 + memcpy(strbuf, str, len) // Copy to HERE fin end def _type_(a,b)#0 @@ -1977,6 +1978,8 @@ loop _estkl = ^(@syscall + 1) // Hack to fill in parameter stack locations _estkh = ^(@syscall + 3) fileio:iobufalloc(4) // Allocate a bunch of file buffers +strbuf = heapalloc(256) +padbuf = heapalloc(256) startheap = heapmark coldstart //