enable --tlsEmulation:on for --gc:arc (#13685)
* enable --tlsEmulation:on for --gc:arc * make -d:useMalloc work with --gc:arc --threads:on
This commit is contained in:
parent
a0ccfd16a7
commit
15ba765ebd
4 changed files with 5 additions and 8 deletions
|
|
@ -559,7 +559,7 @@ proc genNamedParamCall(p: BProc, ri: PNode, d: var TLoc) =
|
||||||
|
|
||||||
proc canRaiseDisp(p: BProc; n: PNode): bool =
|
proc canRaiseDisp(p: BProc; n: PNode): bool =
|
||||||
# we assume things like sysFatal cannot raise themselves
|
# we assume things like sysFatal cannot raise themselves
|
||||||
if n.kind == nkSym and sfNeverRaises in n.sym.flags:
|
if n.kind == nkSym and {sfNeverRaises, sfImportc, sfCompilerProc} * n.sym.flags != {}:
|
||||||
result = false
|
result = false
|
||||||
elif optPanics in p.config.globalOptions or
|
elif optPanics in p.config.globalOptions or
|
||||||
(n.kind == nkSym and sfSystemModule in getModule(n.sym).flags):
|
(n.kind == nkSym and sfSystemModule in getModule(n.sym).flags):
|
||||||
|
|
|
||||||
|
|
@ -339,7 +339,7 @@ when defined(js):
|
||||||
proc reallocShared0(p: pointer, oldsize, newsize: Natural): pointer = discard
|
proc reallocShared0(p: pointer, oldsize, newsize: Natural): pointer = discard
|
||||||
|
|
||||||
|
|
||||||
when hasAlloc and hasThreadSupport:
|
when hasAlloc and hasThreadSupport and not defined(useMalloc):
|
||||||
proc getOccupiedSharedMem*(): int {.rtl.}
|
proc getOccupiedSharedMem*(): int {.rtl.}
|
||||||
## Returns the number of bytes that are owned by the process
|
## Returns the number of bytes that are owned by the process
|
||||||
## on the shared heap and hold data. This is only available when
|
## on the shared heap and hold data. This is only available when
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,6 @@ proc alloc(r: var MemRegion, size: int): pointer =
|
||||||
proc alloc0Impl(r: var MemRegion, size: int): pointer =
|
proc alloc0Impl(r: var MemRegion, size: int): pointer =
|
||||||
result = alloc0Impl(size)
|
result = alloc0Impl(size)
|
||||||
proc dealloc(r: var MemRegion, p: pointer) = dealloc(p)
|
proc dealloc(r: var MemRegion, p: pointer) = dealloc(p)
|
||||||
proc deallocOsPages(r: var MemRegion) {.inline.} = discard
|
proc deallocOsPages(r: var MemRegion) = discard
|
||||||
proc deallocOsPages() {.inline.} = discard
|
proc deallocOsPages() = discard
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ when not defined(useNimRtl):
|
||||||
# use ``stdcall`` since it is mapped to ``noconv`` on UNIX anyway.
|
# use ``stdcall`` since it is mapped to ``noconv`` on UNIX anyway.
|
||||||
|
|
||||||
type
|
type
|
||||||
Thread* {.pure, final.}[TArg] = object
|
Thread*[TArg] = object
|
||||||
core: PGcThread
|
core: PGcThread
|
||||||
sys: SysThread
|
sys: SysThread
|
||||||
when TArg is void:
|
when TArg is void:
|
||||||
|
|
@ -98,9 +98,6 @@ proc onThreadDestruction*(handler: proc () {.closure, gcsafe.}) =
|
||||||
## A thread is destructed when the ``.thread`` proc returns
|
## A thread is destructed when the ``.thread`` proc returns
|
||||||
## normally or when it raises an exception. Note that unhandled exceptions
|
## normally or when it raises an exception. Note that unhandled exceptions
|
||||||
## in a thread nevertheless cause the whole process to die.
|
## in a thread nevertheless cause the whole process to die.
|
||||||
when not defined(nimNoNilSeqs):
|
|
||||||
if threadDestructionHandlers.isNil:
|
|
||||||
threadDestructionHandlers = @[]
|
|
||||||
threadDestructionHandlers.add handler
|
threadDestructionHandlers.add handler
|
||||||
|
|
||||||
template afterThreadRuns() =
|
template afterThreadRuns() =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue