1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2024-10-18 22:24:28 +00:00

Alloc codeseq before data+code buffer

This commit is contained in:
David Schmenk 2018-01-15 21:13:29 -08:00
parent de74f13099
commit c67afa6d24

View File

@ -475,7 +475,7 @@ def set_idfunc(nameptr, len, tag, cparms, cvals)#0
end
def init_idglobal#0
word op
byte i
word i
tag_num = TAGNUM
fixup_num = FIXUPNUM
@ -487,6 +487,19 @@ def init_idglobal#0
globalbufsz = IDGLOBALSZ
localbufsz = IDLOCALSZ/2
fin
//
//Init free op sequence list
//
freeop_lst = heapalloc(OPSEQNUM*t_opseq)
op = freeop_lst
for i = OPSEQNUM-1 downto 0
op=>opnext = op + t_opseq
op = op + t_opseq
next
op=>opnext = NULL
//
// Allocate remaining buffers
//
tag_addr = heapalloc(tag_num*2)
tag_type = heapalloc(tag_num)
fixup_tag = heapalloc(fixup_num*2)
@ -498,16 +511,6 @@ def init_idglobal#0
codeptr = codebuff
lastglobal = idglobal_tbl
puts("Data+Code buffer size = "); puti(codebufsz); putln
//
//Init free op sequence list
//
freeop_lst = heapalloc(OPSEQNUM*t_opseq)
op = freeop_lst
for i = OPSEQNUM-1 downto 0
op=>opnext = op + t_opseq
op = op + t_opseq
next
op=>opnext = NULL
end
def new_idlocal(nameptr, len, type, size)#0
if idmatch(nameptr, len, @idlocal_tbl, locals); exit_err(ERR_DUP|ERR_ID); fin