summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rwxr-xr-xcompiler/ccgstmts.nim3
-rwxr-xr-xcompiler/commands.nim4
-rwxr-xr-xcompiler/options.nim4
-rwxr-xr-xlib/pure/strutils.nim2
-rwxr-xr-xlib/system/mmdisp.nim4
-rw-r--r--tests/reject/tnotnil.nim2
6 files changed, 13 insertions, 6 deletions
diff --git a/compiler/ccgstmts.nim b/compiler/ccgstmts.nim
index 473d10e7b..dd6d2bfaa 100755
--- a/compiler/ccgstmts.nim
+++ b/compiler/ccgstmts.nim
@@ -16,7 +16,8 @@ const
     # above X strings a hash-switch for strings is generated
 
 proc registerGcRoot(p: BProc, v: PSym) =
-  if gSelectedGc == gcMarkAndSweep and containsGarbageCollectedRef(v.loc.t):
+  if gSelectedGc in {gcMarkAndSweep, gcGenerational} and
+      containsGarbageCollectedRef(v.loc.t):
     # we register a specialized marked proc here; this has the advantage
     # that it works out of the box for thread local storage then :-)
     let prc = genTraverseProcForGlobal(p.module, v)
diff --git a/compiler/commands.nim b/compiler/commands.nim
index a2154c907..1da632858 100755
--- a/compiler/commands.nim
+++ b/compiler/commands.nim
@@ -143,6 +143,7 @@ proc testCompileOptionArg*(switch, arg: string, info: TLineInfo): bool =
     of "refc":         result = gSelectedGC == gcRefc
     of "v2":           result = gSelectedGC == gcV2
     of "markandsweep": result = gSelectedGC == gcMarkAndSweep
+    of "generational": result = gSelectedGC == gcGenerational
     of "none":         result = gSelectedGC == gcNone
     else: LocalError(info, errNoneBoehmRefcExpectedButXFound, arg)
   of "opt":
@@ -280,6 +281,9 @@ proc processSwitch(switch, arg: string, pass: TCmdlinePass, info: TLineInfo) =
     of "markandsweep":
       gSelectedGC = gcMarkAndSweep
       defineSymbol("gcmarkandsweep")
+    of "generational":
+      gSelectedGC = gcGenerational
+      defineSymbol("gcgenerational")
     of "none":
       gSelectedGC = gcNone
       defineSymbol("nogc")
diff --git a/compiler/options.nim b/compiler/options.nim
index d74bc7304..9119012f6 100755
--- a/compiler/options.nim
+++ b/compiler/options.nim
@@ -81,7 +81,7 @@ type                          # please make sure we have under 32 options
     cmdRun                    # run the project via TCC backend
   TStringSeq* = seq[string]
   TGCMode* = enum             # the selected GC
-    gcNone, gcBoehm, gcMarkAndSweep, gcRefc, gcV2
+    gcNone, gcBoehm, gcMarkAndSweep, gcRefc, gcV2, gcGenerational
 
 const
   ChecksOptions* = {optObjCheck, optFieldCheck, optRangeCheck, optNilCheck, 
@@ -101,7 +101,7 @@ var
   headerFile*: string = ""
   gVerbosity*: int            # how verbose the compiler is
   gNumberOfProcessors*: int   # number of processors
-  gWholeProject*: bool # for 'doc2': output any dependency
+  gWholeProject*: bool        # for 'doc2': output any dependency
   gEvalExpr* = ""             # expression for idetools --eval
   gLastCmdTime*: float        # when caas is enabled, we measure each command
   gListFullPaths*: bool
diff --git a/lib/pure/strutils.nim b/lib/pure/strutils.nim
index 8b64434d8..090ad640c 100755
--- a/lib/pure/strutils.nim
+++ b/lib/pure/strutils.nim
@@ -754,7 +754,7 @@ proc replaceWord*(s, sub: string, by = ""): string {.noSideEffect,
     else:

       add result, substr(s, i, j)

       i = j + 1

-    # copy the rest:

+  # copy the rest:

   add result, substr(s, i)

 

 proc delete*(s: var string, first, last: int) {.noSideEffect,

diff --git a/lib/system/mmdisp.nim b/lib/system/mmdisp.nim
index eee98fd52..9f37e95c1 100755
--- a/lib/system/mmdisp.nim
+++ b/lib/system/mmdisp.nim
@@ -1,7 +1,7 @@
 #
 #
 #            Nimrod's Runtime Library
-#        (c) Copyright 2012 Andreas Rumpf
+#        (c) Copyright 2013 Andreas Rumpf
 #
 #    See the file "copying.txt", included in this
 #    distribution, for details about the copyright.
@@ -312,6 +312,8 @@ else:
   elif defined(gcMarkAndSweep):
     # XXX use 'compileOption' here
     include "system/gc_ms"
+  elif defined(gcGenerational):
+    include "system/gc_genms"
   else:
     include "system/gc"
   
diff --git a/tests/reject/tnotnil.nim b/tests/reject/tnotnil.nim
index b02e33713..fba7fa917 100644
--- a/tests/reject/tnotnil.nim
+++ b/tests/reject/tnotnil.nim
@@ -1,6 +1,6 @@
 discard """
   line: 22
-  errormgs: "type mismatch"
+  errormsg: "type mismatch"
 """
 
 type