Minor fix to the VM and updated closures test
This commit is contained in:
parent
e759e6cbb2
commit
fc74bab529
|
@ -1025,7 +1025,7 @@ proc run*(self: PeonVM, chunk: Chunk) =
|
|||
# for one GC in this VM :(
|
||||
when defined(gcOrc):
|
||||
GC_disableOrc()
|
||||
when not defined(gcArc):
|
||||
when not defined(gcArc) and not defined(gcOrc):
|
||||
GC_disable()
|
||||
GC_disableMarkAndSweep()
|
||||
try:
|
||||
|
@ -1039,7 +1039,7 @@ proc run*(self: PeonVM, chunk: Chunk) =
|
|||
# but *just in case*
|
||||
when defined(gcOrc):
|
||||
GC_enable_Orc()
|
||||
when not defined(gcArc):
|
||||
when not defined(gcArc) and not defined(gcOrc):
|
||||
GC_enable()
|
||||
GC_enableMarkAndSweep()
|
||||
|
||||
|
|
|
@ -15,5 +15,6 @@ fn makeClosure(n: int): fn: fn: int {
|
|||
|
||||
var closure = makeClosure(38);
|
||||
var inner = closure();
|
||||
print(inner()); # 38!
|
||||
|
||||
print(inner()); # 38
|
||||
print(inner()); # 38
|
||||
print(makeClosure(420)()()); # 420
|
Loading…
Reference in New Issue