bugfix: MS-GC GC_unref
This commit is contained in:
parent
bd705a517f
commit
81d4049797
1 changed files with 2 additions and 1 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue