summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2018-11-15 11:36:28 +0100
committerAndreas Rumpf <rumpf_a@web.de>2018-11-15 11:36:35 +0100
commit632ec94b5d467393acb5c24840e665020275b643 (patch)
tree80b8b4761c5b94bc21b2b45637b5488aedc8467b /lib
parent9eb9a57ffd9bec1f7ba2a92d7dcd80c8366fbc33 (diff)
downloadNim-632ec94b5d467393acb5c24840e665020275b643.tar.gz
gc_common: fixes a typo
Diffstat (limited to 'lib')
-rw-r--r--lib/system/gc_common.nim38
1 files changed, 19 insertions, 19 deletions
diff --git a/lib/system/gc_common.nim b/lib/system/gc_common.nim
index c9866164e..66e0c8e1e 100644
--- a/lib/system/gc_common.nim
+++ b/lib/system/gc_common.nim
@@ -157,25 +157,6 @@ else:
   iterator items(first: var GcStack): ptr GcStack = yield addr(first)
   proc len(stack: var GcStack): int = 1
 
-proc stackSize(stack: ptr GcStack): int {.noinline.} =
-  when nimCoroutines:
-    var pos = stack.pos
-  else:
-    var pos {.volatile.}: pointer
-    pos = addr(pos)
-
-  if pos != nil:
-    when defined(stackIncreases):
-      result = cast[ByteAddress](pos) -% cast[ByteAddress](stack.bottom)
-    else:
-      result = cast[ByteAddress](stack.bottom) -% cast[ByteAddress](pos)
-  else:
-    result = 0
-
-proc stackSize(): int {.noinline.} =
-  for stack in gch.stack.items():
-    result = result + stack.stackSize()
-
 when nimCoroutines:
   proc setPosition(stack: ptr GcStack, position: pointer) =
     stack.pos = position
@@ -246,6 +227,25 @@ elif defined(hppa) or defined(hp9000) or defined(hp9000s300) or
 else:
   const stackIncreases = false
 
+proc stackSize(stack: ptr GcStack): int {.noinline.} =
+  when nimCoroutines:
+    var pos = stack.pos
+  else:
+    var pos {.volatile.}: pointer
+    pos = addr(pos)
+
+  if pos != nil:
+    when stackIncreases:
+      result = cast[ByteAddress](pos) -% cast[ByteAddress](stack.bottom)
+    else:
+      result = cast[ByteAddress](stack.bottom) -% cast[ByteAddress](pos)
+  else:
+    result = 0
+
+proc stackSize(): int {.noinline.} =
+  for stack in gch.stack.items():
+    result = result + stack.stackSize()
+
 {.push stack_trace: off.}
 when nimCoroutines:
   proc GC_addStack(bottom: pointer) {.cdecl, exportc.} =