summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2020-03-18 23:52:49 +0100
committerGitHub <noreply@github.com>2020-03-18 23:52:49 +0100
commit15ba765ebd83e44d18a0a2c23016bdf3b4bbecca (patch)
tree5005cd7ea1d61b1e8ecc76d002c98d52f6c141cb
parenta0ccfd16a77ea0e9ef3077dadf62de5fe9c52004 (diff)
downloadNim-15ba765ebd83e44d18a0a2c23016bdf3b4bbecca.tar.gz
enable --tlsEmulation:on for --gc:arc (#13685)
* enable --tlsEmulation:on for --gc:arc
* make -d:useMalloc work with --gc:arc --threads:on
-rw-r--r--compiler/ccgcalls.nim2
-rw-r--r--lib/system/memalloc.nim2
-rw-r--r--lib/system/mm/malloc.nim4
-rw-r--r--lib/system/threads.nim5
4 files changed, 5 insertions, 8 deletions
diff --git a/compiler/ccgcalls.nim b/compiler/ccgcalls.nim
index 3be3cbb6b..de979f4a0 100644
--- a/compiler/ccgcalls.nim
+++ b/compiler/ccgcalls.nim
@@ -559,7 +559,7 @@ proc genNamedParamCall(p: BProc, ri: PNode, d: var TLoc) =
 
 proc canRaiseDisp(p: BProc; n: PNode): bool =
   # 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
   elif optPanics in p.config.globalOptions or
       (n.kind == nkSym and sfSystemModule in getModule(n.sym).flags):
diff --git a/lib/system/memalloc.nim b/lib/system/memalloc.nim
index df4df2c15..178d199b8 100644
--- a/lib/system/memalloc.nim
+++ b/lib/system/memalloc.nim
@@ -339,7 +339,7 @@ when defined(js):
   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.}
     ## Returns the number of bytes that are owned by the process
     ## on the shared heap and hold data. This is only available when
diff --git a/lib/system/mm/malloc.nim b/lib/system/mm/malloc.nim
index 27e32f87d..ad510cef2 100644
--- a/lib/system/mm/malloc.nim
+++ b/lib/system/mm/malloc.nim
@@ -75,6 +75,6 @@ proc alloc(r: var MemRegion, size: int): pointer =
 proc alloc0Impl(r: var MemRegion, size: int): pointer =
   result = alloc0Impl(size)
 proc dealloc(r: var MemRegion, p: pointer) = dealloc(p)
-proc deallocOsPages(r: var MemRegion) {.inline.} = discard
-proc deallocOsPages() {.inline.} = discard
+proc deallocOsPages(r: var MemRegion) = discard
+proc deallocOsPages() = discard
 
diff --git a/lib/system/threads.nim b/lib/system/threads.nim
index 54b07e467..b3a4e32e4 100644
--- a/lib/system/threads.nim
+++ b/lib/system/threads.nim
@@ -79,7 +79,7 @@ when not defined(useNimRtl):
 # use ``stdcall`` since it is mapped to ``noconv`` on UNIX anyway.
 
 type
-  Thread* {.pure, final.}[TArg] = object
+  Thread*[TArg] = object
     core: PGcThread
     sys: SysThread
     when TArg is void:
@@ -98,9 +98,6 @@ proc onThreadDestruction*(handler: proc () {.closure, gcsafe.}) =
   ## A thread is destructed when the ``.thread`` proc returns
   ## normally or when it raises an exception. Note that unhandled exceptions
   ## in a thread nevertheless cause the whole process to die.
-  when not defined(nimNoNilSeqs):
-    if threadDestructionHandlers.isNil:
-      threadDestructionHandlers = @[]
   threadDestructionHandlers.add handler
 
 template afterThreadRuns() =