summary refs log tree commit diff stats
path: root/lib/system.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2011-06-15 02:09:02 +0200
committerAraq <rumpf_a@web.de>2011-06-15 02:09:02 +0200
commit4fa80956b89c2ee06d8940018101240efec7dc02 (patch)
tree5e3d03d41122f0ad8def8e7d9be8b2eff2a2ea81 /lib/system.nim
parentadbb48fbcecd82e60c3a25ee006baa0aa5dd7b10 (diff)
downloadNim-4fa80956b89c2ee06d8940018101240efec7dc02.tar.gz
compiler can emulate thread local variables
Diffstat (limited to 'lib/system.nim')
-rwxr-xr-xlib/system.nim9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/system.nim b/lib/system.nim
index 1c8bf3ae9..7670288fc 100755
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -1479,8 +1479,6 @@ when not defined(EcmaScript) and not defined(NimrodVM):
   strDesc.size = sizeof(string)
   strDesc.kind = tyString
   strDesc.flags = {ntfAcyclic}
-  initStackBottom()
-  initGC() # BUGFIX: need to be called here!
 
   include "system/ansi_c"
 
@@ -1692,6 +1690,10 @@ when not defined(EcmaScript) and not defined(NimrodVM):
 
   when hasThreadSupport:
     include "system/threads"
+  else:
+    initStackBottom()
+    initGC()
+    
   include "system/excpt"
   # we cannot compile this with stack tracing on
   # as it would recurse endlessly!
@@ -1755,8 +1757,7 @@ when not defined(EcmaScript) and not defined(NimrodVM):
 
   proc getCurrentException*(): ref E_Base {.compilerRtl, inl.} =
     ## retrieves the current exception; if there is none, nil is returned.
-    ThreadGlobals()
-    result = ||currException
+    result = currException
 
   proc getCurrentExceptionMsg*(): string {.inline.} =
     ## retrieves the error message that was attached to the current