gc_common: fixes a typo
This commit is contained in:
parent
9eb9a57ffd
commit
632ec94b5d
1 changed files with 19 additions and 19 deletions
|
|
@ -157,25 +157,6 @@ else:
|
||||||
iterator items(first: var GcStack): ptr GcStack = yield addr(first)
|
iterator items(first: var GcStack): ptr GcStack = yield addr(first)
|
||||||
proc len(stack: var GcStack): int = 1
|
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:
|
when nimCoroutines:
|
||||||
proc setPosition(stack: ptr GcStack, position: pointer) =
|
proc setPosition(stack: ptr GcStack, position: pointer) =
|
||||||
stack.pos = position
|
stack.pos = position
|
||||||
|
|
@ -246,6 +227,25 @@ elif defined(hppa) or defined(hp9000) or defined(hp9000s300) or
|
||||||
else:
|
else:
|
||||||
const stackIncreases = false
|
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.}
|
{.push stack_trace: off.}
|
||||||
when nimCoroutines:
|
when nimCoroutines:
|
||||||
proc GC_addStack(bottom: pointer) {.cdecl, exportc.} =
|
proc GC_addStack(bottom: pointer) {.cdecl, exportc.} =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue