diff options
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/system/gc.nim | 16 | ||||
-rwxr-xr-x | lib/system/systhread.nim | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/lib/system/gc.nim b/lib/system/gc.nim index 59ddda5e7..cd803d70a 100755 --- a/lib/system/gc.nim +++ b/lib/system/gc.nim @@ -487,14 +487,14 @@ when not defined(useNimRtl): stackBottom = cast[pointer](max(a, b)) proc stackSize(): int {.noinline.} = - var stackTop: array[0..1, pointer] - result = abs(cast[int](addr(stackTop[0])) - cast[int](stackBottom)) + var stackTop {.volatile.}: pointer + result = abs(cast[int](addr(stackTop)) - cast[int](stackBottom)) when defined(sparc): # For SPARC architecture. proc isOnStack(p: pointer): bool = - var stackTop: array [0..1, pointer] + var stackTop {.volatile.}: pointer var b = cast[TAddress](stackBottom) - var a = cast[TAddress](addr(stackTop[0])) + var a = cast[TAddress](addr(stackTop)) var x = cast[TAddress](p) result = x >=% a and x <=% b @@ -522,9 +522,9 @@ elif stackIncreases: # Generic code for architectures where addresses increase as the stack grows. # --------------------------------------------------------------------------- proc isOnStack(p: pointer): bool = - var stackTop: array [0..1, pointer] + var stackTop {.volatile.}: pointer var a = cast[TAddress](stackBottom) - var b = cast[TAddress](addr(stackTop[0])) + var b = cast[TAddress](addr(stackTop)) var x = cast[TAddress](p) result = x >=% a and x <=% b @@ -549,9 +549,9 @@ else: # Generic code for architectures where addresses decrease as the stack grows. # --------------------------------------------------------------------------- proc isOnStack(p: pointer): bool = - var stackTop: array [0..1, pointer] + var stackTop {.volatile.}: pointer var b = cast[TAddress](stackBottom) - var a = cast[TAddress](addr(stackTop[0])) + var a = cast[TAddress](addr(stackTop)) var x = cast[TAddress](p) result = x >=% a and x <=% b diff --git a/lib/system/systhread.nim b/lib/system/systhread.nim index 68121661f..58482ac65 100755 --- a/lib/system/systhread.nim +++ b/lib/system/systhread.nim @@ -40,7 +40,7 @@ proc atomicDec(memLoc: var int, x: int): int = type TThread* {.final, pure.} = object next: ptr TThread - TThreadFunc* = proc (closure: pointer) {.cdecl.} + TThreadFunc* = proc (closure: pointer) proc createThread*(t: var TThread, fn: TThreadFunc) = nil |