mirror of
https://github.com/dschmenk/PLASMA.git
synced 2025-04-19 22:38:50 +00:00
Fix freeing heap in init when running on 64K VM
This commit is contained in:
parent
52b47c571e
commit
4e1c6a5963
@ -160,17 +160,6 @@ end
|
||||
// REPL
|
||||
//
|
||||
|
||||
def print_syms#0
|
||||
var symptr
|
||||
|
||||
symptr = new_sym("PRINT")
|
||||
while symptr
|
||||
print_expr(symptr)
|
||||
symptr = symptr=>link
|
||||
loop
|
||||
end
|
||||
|
||||
print_syms
|
||||
parse_cmdline
|
||||
new_sym("BYE")=>natv = @natv_bye
|
||||
new_sym("MEM")=>natv = @natv_memavail
|
||||
|
@ -191,7 +191,6 @@ def match_sym(symstr)
|
||||
if symptr->name[i] <> symstr->[i]; break; fin
|
||||
next
|
||||
if i > len
|
||||
puts("Match symbol:"); puts(symstr - 1); putln
|
||||
return symptr
|
||||
fin
|
||||
fin
|
||||
@ -203,7 +202,6 @@ end
|
||||
export def new_sym(symstr)#1
|
||||
var symptr
|
||||
|
||||
puts("sym_list(@$"); puth(@sym_list); puts("):$"); puth(sym_list); putln
|
||||
symptr = match_sym(symstr)
|
||||
if symptr; return symptr; fin // Return already existing symbol
|
||||
symptr = heapalloc(t_sym + ^symstr)
|
||||
@ -213,7 +211,6 @@ export def new_sym(symstr)#1
|
||||
symptr=>natv = NULL
|
||||
symptr=>lambda = NULL
|
||||
memcpy(symptr + name, symstr + 1, ^symstr)
|
||||
puts("New symbol:"); puts(symstr); putln
|
||||
return symptr
|
||||
end
|
||||
|
||||
@ -514,16 +511,6 @@ def enter_lambda(expr, params)
|
||||
return expr=>cdr=>cdr=>car
|
||||
end
|
||||
|
||||
def print_syms#0
|
||||
var symptr
|
||||
|
||||
symptr = sym_list
|
||||
while symptr
|
||||
print_atom(symptr)
|
||||
symptr = symptr=>link
|
||||
loop
|
||||
end
|
||||
|
||||
export def eval_expr(expr)#1
|
||||
var alist_enter, result
|
||||
|
||||
@ -535,8 +522,6 @@ export def eval_expr(expr)#1
|
||||
// List - first element better be a function
|
||||
//
|
||||
if expr=>car->type & TYPE_MASK == SYM_TYPE
|
||||
puts("Calling function:"); print_atom(expr=>car); putc('@'); puth(expr=>car=>natv); putln
|
||||
print_syms
|
||||
if expr=>car=>natv
|
||||
result = expr=>car=>natv(expr=>cdr) // Native function
|
||||
expr = NULL
|
||||
@ -822,5 +807,5 @@ new_sym("NEG")=>natv = @natv_neg
|
||||
new_sym(">")=>natv = @natv_gt
|
||||
new_sym("<")=>natv = @natv_lt
|
||||
new_sym("PRINT")=>natv = @natv_print
|
||||
puts("func + address:"); puth(match_sym("+")=>natv); putln
|
||||
return modkeep | modinitkeep
|
||||
done
|
||||
|
Loading…
x
Reference in New Issue
Block a user