mark and sweep GC without bitvectors works

This commit is contained in:
Araq 2013-02-19 23:07:08 +01:00
commit 4fc575bc26
3 changed files with 8 additions and 5 deletions

View file

@ -319,7 +319,8 @@ iterator allObjects(m: TMemRegion): pointer {.inline.} =
let size = c.size let size = c.size
var a = cast[TAddress](addr(c.data)) var a = cast[TAddress](addr(c.data))
while a <% c.acc: let limit = a + c.acc
while a <% limit:
yield cast[pointer](a) yield cast[pointer](a)
a = a +% size a = a +% size
else: else:

View file

@ -13,7 +13,9 @@
const const
InitialThreshold = 4*1024*1024 # X MB because marking&sweeping is slow InitialThreshold = 4*1024*1024 # X MB because marking&sweeping is slow
withBitvectors = defined(gcUseBitvectors) withBitvectors = defined(gcUseBitvectors)
# bitvectors are significantly faster for GC-bench, but slower for
# bootstrapping and use more memory
rcWhite = 0 rcWhite = 0
rcGrey = 1 # unused rcGrey = 1 # unused
rcBlack = 2 rcBlack = 2

View file

@ -2,9 +2,8 @@ version 0.9.2
============= =============
- FFI: - FFI:
* test libffi on windows --> fowl * test libffi on windows
* test: times.format with the FFI * test: times.format with the FFI
- GC: variation of m&s GC
- GC: implement simple generational GC - GC: implement simple generational GC
* first version: mark black in write barrier * first version: mark black in write barrier
* second version: introduce fake roots instead of marking black * second version: introduce fake roots instead of marking black
@ -108,7 +107,8 @@ GC
Optimizations Optimizations
============= =============
- optimize 'if' with a constant condition - optimize 'if' with a constant condition --> necessary in frontend for better
dead code elimination
- escape analysis for string/seq seems to be easy to do too; - escape analysis for string/seq seems to be easy to do too;
even further write barrier specialization even further write barrier specialization
- inlining of first class functions - inlining of first class functions