newruntime: only check for dangling refs when 'owned ref T' support is enabled
This commit is contained in:
parent
4c9a7e6f00
commit
3f4b9971fc
1 changed files with 8 additions and 7 deletions
|
|
@ -71,6 +71,7 @@ proc nimIncRef(p: pointer) {.compilerRtl, inl.} =
|
||||||
|
|
||||||
proc nimRawDispose(p: pointer) {.compilerRtl.} =
|
proc nimRawDispose(p: pointer) {.compilerRtl.} =
|
||||||
when not defined(nimscript):
|
when not defined(nimscript):
|
||||||
|
when defined(nimOwnedEnabled):
|
||||||
when hasThreadSupport:
|
when hasThreadSupport:
|
||||||
let hasDanglingRefs = atomicLoadN(addr head(p).rc, ATOMIC_RELAXED) != 0
|
let hasDanglingRefs = atomicLoadN(addr head(p).rc, ATOMIC_RELAXED) != 0
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue