mirror of
https://github.com/badvision/lawless-legends.git
synced 2024-07-07 14:29:16 +00:00
Get free heap sane
This commit is contained in:
parent
9e25d063fc
commit
7e866f97f5
@ -31,15 +31,6 @@ predef uword_isgt, uword_isge, uword_islt, uword_isle
|
|||||||
predef getpfx, setpfx, newline, online, open, close, read, write, create, destroy
|
predef getpfx, setpfx, newline, online, open, close, read, write, create, destroy
|
||||||
predef execmod
|
predef execmod
|
||||||
;
|
;
|
||||||
; String pool.
|
|
||||||
;
|
|
||||||
byte version[] = "PLASMA 0.9\n"
|
|
||||||
byte errorstr[] = "ERR: "
|
|
||||||
byte okstr[] = "OK"
|
|
||||||
;byte heapstr[] = "HEAP START: $"
|
|
||||||
byte freestr[] = "MEM FREE:$"
|
|
||||||
byte prefix[32] = ""
|
|
||||||
;
|
|
||||||
; Standard Library exported functions.
|
; Standard Library exported functions.
|
||||||
;
|
;
|
||||||
byte stdlibstr[] = "STDLIB"
|
byte stdlibstr[] = "STDLIB"
|
||||||
@ -89,12 +80,20 @@ word = @execstr, @execmod
|
|||||||
word = 0
|
word = 0
|
||||||
word stdlibsym = @exports
|
word stdlibsym = @exports
|
||||||
;
|
;
|
||||||
|
; String pool.
|
||||||
|
;
|
||||||
|
byte version[] = "PLASMA 0.9\n"
|
||||||
|
byte errorstr[] = "ERR: "
|
||||||
|
byte okstr[] = "OK"
|
||||||
|
byte freestr[] = "MEM FREE:$"
|
||||||
|
byte prefix[32] = ""
|
||||||
|
;
|
||||||
; System variable.
|
; System variable.
|
||||||
;
|
;
|
||||||
word heapsttart, heap
|
word heapsttart, heap
|
||||||
|
word lastsym = symtbl
|
||||||
word xheap = $0400
|
word xheap = $0400
|
||||||
word sysflags = 0
|
word sysflags = 0
|
||||||
word lastsym
|
|
||||||
word perr
|
word perr
|
||||||
word cmdptr
|
word cmdptr
|
||||||
;
|
;
|
||||||
@ -1417,9 +1416,7 @@ def execmod(modfile)
|
|||||||
fin
|
fin
|
||||||
end
|
end
|
||||||
|
|
||||||
resetmemfiles()
|
|
||||||
heap = *freemem
|
heap = *freemem
|
||||||
lastsym = symtbl
|
|
||||||
stodci(@stdlibstr, $0280)
|
stodci(@stdlibstr, $0280)
|
||||||
addmod($0280, 1)
|
addmod($0280, 1)
|
||||||
while *stdlibsym
|
while *stdlibsym
|
||||||
@ -1427,6 +1424,7 @@ while *stdlibsym
|
|||||||
addsym($0280, (stdlibsym):2)
|
addsym($0280, (stdlibsym):2)
|
||||||
stdlibsym = stdlibsym + 4
|
stdlibsym = stdlibsym + 4
|
||||||
loop
|
loop
|
||||||
|
resetmemfiles()
|
||||||
prstr(@version)
|
prstr(@version)
|
||||||
prstr(@freestr)
|
prstr(@freestr)
|
||||||
prword(availheap)
|
prword(availheap)
|
||||||
|
Loading…
Reference in New Issue
Block a user