diff options
author | Araq <rumpf_a@web.de> | 2013-02-19 23:07:08 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2013-02-19 23:07:08 +0100 |
commit | 4fc575bc26b4d521f1092572fe93c2bebfe12f7b (patch) | |
tree | 4cf5fc13834fc16d2cfa0cadd2ee8bac77b22c24 | |
parent | a4d47664d61f7d24d80d56997ee4a733f8f13e7a (diff) | |
download | Nim-4fc575bc26b4d521f1092572fe93c2bebfe12f7b.tar.gz |
mark and sweep GC without bitvectors works
-rwxr-xr-x | lib/system/alloc.nim | 3 | ||||
-rw-r--r-- | lib/system/gc_ms.nim | 4 | ||||
-rwxr-xr-x | todo.txt | 6 |
3 files changed, 8 insertions, 5 deletions
diff --git a/lib/system/alloc.nim b/lib/system/alloc.nim index 55e1c26a7..7b52780fe 100755 --- a/lib/system/alloc.nim +++ b/lib/system/alloc.nim @@ -319,7 +319,8 @@ iterator allObjects(m: TMemRegion): pointer {.inline.} = let size = c.size var a = cast[TAddress](addr(c.data)) - while a <% c.acc: + let limit = a + c.acc + while a <% limit: yield cast[pointer](a) a = a +% size else: diff --git a/lib/system/gc_ms.nim b/lib/system/gc_ms.nim index 15975c035..9ebc27a9f 100644 --- a/lib/system/gc_ms.nim +++ b/lib/system/gc_ms.nim @@ -13,7 +13,9 @@ const 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 rcGrey = 1 # unused rcBlack = 2 diff --git a/todo.txt b/todo.txt index 64dcafcb5..eb9059f12 100755 --- a/todo.txt +++ b/todo.txt @@ -2,9 +2,8 @@ version 0.9.2 ============= - FFI: - * test libffi on windows --> fowl + * test libffi on windows * test: times.format with the FFI -- GC: variation of m&s GC - GC: implement simple generational GC * first version: mark black in write barrier * second version: introduce fake roots instead of marking black @@ -108,7 +107,8 @@ GC 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; even further write barrier specialization - inlining of first class functions |