gc.nim: Add a gcAssert to enforce the no heap sharing restrictions
This commit is contained in:
parent
3647c9c822
commit
f1bf65f66e
1 changed files with 1 additions and 0 deletions
|
|
@ -639,6 +639,7 @@ when useMarkForDebug or useBackupGc:
|
||||||
while gch.tempStack.len > 0:
|
while gch.tempStack.len > 0:
|
||||||
dec gch.tempStack.len
|
dec gch.tempStack.len
|
||||||
var d = gch.tempStack.d[gch.tempStack.len]
|
var d = gch.tempStack.d[gch.tempStack.len]
|
||||||
|
gcAssert isAllocatedPtr(gch.region, d), "markS: foreign heap root detected!"
|
||||||
if not containsOrIncl(gch.marked, d):
|
if not containsOrIncl(gch.marked, d):
|
||||||
forAllChildren(d, waMarkPrecise)
|
forAllChildren(d, waMarkPrecise)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue