mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-22 23:35:22 +00:00
new gensym handling (#11985)
* new .gensym implementation * make astspec test green again * introduce a --useVersion switch to group compatibility switches * fixes #10180 * fixes #11494 * fixes #11483 * object constructor fields and named parameters are also not gensym'ed * disabled broken package
This commit is contained in:
@@ -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.}
|
||||
|
||||
@@ -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) =
|
||||
|
||||
Reference in New Issue
Block a user