diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/core/locks.nim | 4 | ||||
-rw-r--r-- | lib/system/alloc.nim | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/lib/core/locks.nim b/lib/core/locks.nim index d6d579ba0..0143957ce 100644 --- a/lib/core/locks.nim +++ b/lib/core/locks.nim @@ -60,11 +60,11 @@ template withLock*(a: Lock, body: untyped) = ## Acquires the given lock, executes the statements in body and ## releases the lock after the statements finish executing. mixin acquire, release - a.acquire() + acquire(a) {.locks: [a].}: try: body finally: - a.release() + release(a) {.pop.} diff --git a/lib/system/alloc.nim b/lib/system/alloc.nim index 9c47d9de9..efbd95089 100644 --- a/lib/system/alloc.nim +++ b/lib/system/alloc.nim @@ -984,7 +984,7 @@ when defined(nimTypeNames): # ---------------------- thread memory region ------------------------------- -template instantiateForRegion(allocator: untyped) = +template instantiateForRegion(allocator: untyped) {.dirty.} = {.push stackTrace: off.} when defined(fulldebug): @@ -1006,8 +1006,8 @@ template instantiateForRegion(allocator: untyped) = proc dealloc(p: pointer) = dealloc(allocator, p) - proc realloc(p: pointer, newsize: Natural): pointer = - result = realloc(allocator, p, newsize) + proc realloc(p: pointer, newSize: Natural): pointer = + result = realloc(allocator, p, newSize) when false: proc countFreeMem(): int = @@ -1054,13 +1054,13 @@ template instantiateForRegion(allocator: untyped) = else: dealloc(p) - proc reallocShared(p: pointer, newsize: Natural): pointer = + proc reallocShared(p: pointer, newSize: Natural): pointer = when hasThreadSupport: acquireSys(heapLock) - result = realloc(sharedHeap, p, newsize) + result = realloc(sharedHeap, p, newSize) releaseSys(heapLock) else: - result = realloc(p, newsize) + result = realloc(p, newSize) when hasThreadSupport: template sharedMemStatsShared(v: int) = |