gc.nim: Add a gcAssert to enforce the no heap sharing restrictions

This commit is contained in:
Araq
2018-01-12 15:08:02 +01:00
parent 3647c9c822
commit f1bf65f66e

View File

@@ -639,6 +639,7 @@ when useMarkForDebug or useBackupGc:
while gch.tempStack.len > 0:
dec 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):
forAllChildren(d, waMarkPrecise)