1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2024-06-09 10:29:35 +00:00

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
This commit is contained in:
David Schmenk 2024-01-14 17:54:17 -08:00
parent 1be159e3ed
commit 751799352c

View File

@ -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
//