code cleanup for mark&sweep GC

This commit is contained in:
Araq 2013-02-07 16:09:46 +01:00
commit 4ee9816a78
7 changed files with 43 additions and 88 deletions

View file

@ -40,6 +40,8 @@ proc main =
for i in 0 .. s.high:
s[i] = register(create())
# test that we have at least 80% unreachable weak objects by now:
when defined(gcMarkAndSweep):
GC_fullcollect()
var unreachable = 0
for i in 0 .. s.high:
if access(s[i]) == nil: inc unreachable