newruntime: only check for dangling refs when 'owned ref T' support is enabled

This commit is contained in:
Andreas Rumpf 2019-11-03 09:46:33 +01:00
commit 3f4b9971fc

View file

@ -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: