summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2012-01-10 01:01:21 +0100
committerAraq <rumpf_a@web.de>2012-01-10 01:01:21 +0100
commit6599dca857a0b597084fb18c5802d368c8a75cb2 (patch)
tree673db6ae00d38a1046846e45e6cc621b69a1449c
parente7e3c451efa3207339eea01b8eba0b76dd4bfc91 (diff)
downloadNim-6599dca857a0b597084fb18c5802d368c8a75cb2.tar.gz
GC: interior pointers on stack are not necessarily aligned
-rwxr-xr-xlib/system/gc.nim9
1 files changed, 1 insertions, 8 deletions
diff --git a/lib/system/gc.nim b/lib/system/gc.nim
index 6fa5d09b8..2f6b5d395 100755
--- a/lib/system/gc.nim
+++ b/lib/system/gc.nim
@@ -559,7 +559,7 @@ proc gcMark(gch: var TGcHeap, p: pointer) {.inline.} =
   # the addresses are not as cells on the stack, so turn them to cells:
   var cell = usrToCell(p)
   var c = cast[TAddress](cell)
-  if c >% PageSize and (c and (MemAlign-1)) == 0:
+  if c >% PageSize:
     # fast check: does it look like a cell?
     var objStart = cast[PCell](interiorAllocatedPtr(gch.region, cell))
     if objStart != nil:
@@ -578,13 +578,6 @@ proc nimKeepAlive(p: PGenericSeq) {.compilerRtl, noinline.} =
   if isAllocatedPtr(gch.region, c):
     c.refcount = c.refcount or rcMarked
 
-proc nimGCFrame(p: pointer) {.compilerRtl, noinline.} =
-  # 'cast' is correct here! no offset to add:
-  var c = cast[PCell](p)
-  var x = cast[TAddress](c)
-  if x <% PageSize and (x and (MemAlign-1)) == 0:
-    c.refcount = c.refcount or rcMarked
-
 proc markThreadStacks(gch: var TGcHeap) = 
   when hasThreadSupport and hasSharedHeap:
     {.error: "not fully implemented".}