bugfix: MS-GC GC_unref

This commit is contained in:
Araq 2014-04-30 01:05:52 +02:00
commit 81d4049797

View file

@ -143,7 +143,7 @@ proc nimGCref(p: pointer) {.compilerProc.} =
proc nimGCunref(p: pointer) {.compilerProc.} = proc nimGCunref(p: pointer) {.compilerProc.} =
let cell = usrToCell(p) let cell = usrToCell(p)
var L = gch.additionalRoots.len var L = gch.additionalRoots.len-1
var i = L var i = L
let d = gch.additionalRoots.d let d = gch.additionalRoots.d
while i >= 0: while i >= 0:
@ -151,6 +151,7 @@ proc nimGCunref(p: pointer) {.compilerProc.} =
d[i] = d[L] d[i] = d[L]
dec gch.additionalRoots.len dec gch.additionalRoots.len
break break
dec(i)
when false: when false:
when withBitvectors: incl(gch.allocated, usrToCell(p)) when withBitvectors: incl(gch.allocated, usrToCell(p))
else: usrToCell(p).refcount = rcWhite else: usrToCell(p).refcount = rcWhite