summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2012-01-13 21:15:52 +0100
committerAraq <rumpf_a@web.de>2012-01-13 21:15:52 +0100
commit9460f7cc4e3d76e9f62e645b96890794bae7933c (patch)
treed50fd7c8a670653f37b8c43f2b65c2b31038cd4c
parent8ed3e295a3eac77ffc6dfc890c5c7721942f9173 (diff)
downloadNim-9460f7cc4e3d76e9f62e645b96890794bae7933c.tar.gz
GC: growObj: revert to somewhat more efficient version
-rwxr-xr-xlib/system/gc.nim6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/system/gc.nim b/lib/system/gc.nim
index 077f94905..262ca9971 100755
--- a/lib/system/gc.nim
+++ b/lib/system/gc.nim
@@ -465,14 +465,14 @@ proc growObj(old: pointer, newsize: int, gch: var TGcHeap): pointer =
   sysAssert(ol.typ.kind in {tyString, tySequence}, "growObj: 2")
   sysAssert(allocInv(gch.region), "growObj begin")
 
-  var res = cast[PCell](rawAlloc0(gch.region, newsize + sizeof(TCell)))
+  var res = cast[PCell](rawAlloc(gch.region, newsize + sizeof(TCell)))
   var elemSize = 1
   if ol.typ.kind != tyString: elemSize = ol.typ.base.size
   
   var oldsize = cast[PGenericSeq](old).len*elemSize + GenericSeqSize
   copyMem(res, ol, oldsize + sizeof(TCell))
-  #zeroMem(cast[pointer](cast[TAddress](res)+% oldsize +% sizeof(TCell)),
-  #        newsize-oldsize)
+  zeroMem(cast[pointer](cast[TAddress](res)+% oldsize +% sizeof(TCell)),
+          newsize-oldsize)
   sysAssert((cast[TAddress](res) and (MemAlign-1)) == 0, "growObj: 3")
   sysAssert(res.refcount shr rcShift <=% 1, "growObj: 4")
   #if res.refcount <% rcIncrement: