diff options
-rwxr-xr-x | config/nimrod.cfg | 2 | ||||
-rwxr-xr-x | lib/system/gc.nim | 27 | ||||
-rwxr-xr-x | lib/system/systhread.nim | 3 |
3 files changed, 17 insertions, 15 deletions
diff --git a/config/nimrod.cfg b/config/nimrod.cfg index b2984c204..7e8d4b777 100755 --- a/config/nimrod.cfg +++ b/config/nimrod.cfg @@ -82,7 +82,7 @@ gcc.options.debug = "-g" @end @else: @if not release: - gcc.options.always = "-w -O1" + gcc.options.always = "-w" @else: gcc.options.always = "-w" @end diff --git a/lib/system/gc.nim b/lib/system/gc.nim index 3a7270539..15d2df70e 100755 --- a/lib/system/gc.nim +++ b/lib/system/gc.nim @@ -80,15 +80,13 @@ var proc aquire(gch: var TGcHeap) {.inline.} = when hasThreadSupport: - if isMultiThreaded: - aquireSys(gch.zctLock) - aquireSys(gch.cycleRootsLock) + aquireSys(gch.zctLock) + aquireSys(gch.cycleRootsLock) proc release(gch: var TGcHeap) {.inline.} = when hasThreadSupport: - if isMultiThreaded: - releaseSys(gch.zctLock) - releaseSys(gch.cycleRootsLock) + releaseSys(gch.cycleRootsLock) + releaseSys(gch.zctLock) proc addZCT(s: var TCellSeq, c: PCell) {.noinline.} = if (c.refcount and rcZct) == 0: @@ -207,18 +205,18 @@ proc prepareDealloc(cell: PCell) = proc rtlAddCycleRoot(c: PCell) {.rtl, inl.} = # we MUST access gch as a global here, because this crosses DLL boundaries! when hasThreadSupport: - if isMultiThreaded: AquireSys(gch.cycleRootsLock) + AquireSys(gch.cycleRootsLock) incl(gch.cycleRoots, c) when hasThreadSupport: - if isMultiThreaded: ReleaseSys(gch.cycleRootsLock) + ReleaseSys(gch.cycleRootsLock) proc rtlAddZCT(c: PCell) {.rtl, inl.} = # we MUST access gch as a global here, because this crosses DLL boundaries! when hasThreadSupport: - if isMultiThreaded: AquireSys(gch.zctLock) + AquireSys(gch.zctLock) addZCT(gch.zct, c) when hasThreadSupport: - if isMultiThreaded: ReleaseSys(gch.zctLock) + ReleaseSys(gch.zctLock) proc decRef(c: PCell) {.inline.} = when stressGC: @@ -561,8 +559,9 @@ proc stackSize(): int {.noinline.} = when defined(sparc): # For SPARC architecture. proc isOnStack(p: pointer): bool = var stackTop {.volatile.}: pointer + stackTop = addr(stackTop) var b = cast[TAddress](stackBottom) - var a = cast[TAddress](addr(stackTop)) + var a = cast[TAddress](stackTop) var x = cast[TAddress](p) result = a <=% x and x <=% b @@ -591,8 +590,9 @@ elif stackIncreases: # --------------------------------------------------------------------------- proc isOnStack(p: pointer): bool = var stackTop {.volatile.}: pointer + stackTop = addr(stackTop) var a = cast[TAddress](stackBottom) - var b = cast[TAddress](addr(stackTop)) + var b = cast[TAddress](stackTop) var x = cast[TAddress](p) result = a <=% x and x <=% b @@ -618,8 +618,9 @@ else: # --------------------------------------------------------------------------- proc isOnStack(p: pointer): bool = var stackTop {.volatile.}: pointer + stackTop = addr(stackTop) var b = cast[TAddress](stackBottom) - var a = cast[TAddress](addr(stackTop)) + var a = cast[TAddress](stackTop) var x = cast[TAddress](p) result = a <=% x and x <=% b diff --git a/lib/system/systhread.nim b/lib/system/systhread.nim index 2b5057ff0..c497cc961 100755 --- a/lib/system/systhread.nim +++ b/lib/system/systhread.nim @@ -77,7 +77,8 @@ when defined(Windows): else: type - TSysLock {.importc: "pthread_mutex_t", header: "<sys/types.h>".} = int + TSysLock {.importc: "pthread_mutex_t", pure, final, + header: "<sys/types.h>".} = object proc InitSysLock(L: var TSysLock, attr: pointer = nil) {. importc: "pthread_mutex_init", header: "<pthread.h>".} |