summary refs log tree commit diff stats
path: root/lib/system.nim
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2022-11-23 03:39:30 +0800
committerGitHub <noreply@github.com>2022-11-22 20:39:30 +0100
commit09b7f90475006c58139da5b959b6ea3f47c0e5c1 (patch)
treefabbcf40f47f5f672abd88d9f5d832bba98a3dc5 /lib/system.nim
parent8cfce70738de2d488b621e6936e6398bfbe0a3ce (diff)
downloadNim-09b7f90475006c58139da5b959b6ea3f47c0e5c1.tar.gz
move `system/atomics` out of system; `std/atomics` should be preferred (#20875)
* move `system/atomics` out of system; `std/atomics` should be preferred

* add deprecation message

* fixes

* fixes

* fixes

* fixes more tests
Diffstat (limited to 'lib/system.nim')
-rw-r--r--lib/system.nim21
1 files changed, 8 insertions, 13 deletions
diff --git a/lib/system.nim b/lib/system.nim
index ae07e58f3..c41b3cb9d 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -1394,13 +1394,15 @@ when not defined(js) and not defined(booting) and defined(nimTrMacros):
     swap(cast[ptr pointer](addr arr[a])[], cast[ptr pointer](addr arr[b])[])
 
 when not defined(nimscript):
-  proc atomicInc*(memLoc: var int, x: int = 1): int {.inline,
-                                                     discardable, raises: [], tags: [], benign.}
-  ## Atomic increment of `memLoc`. Returns the value after the operation.
+  {.push stackTrace: off, profiler: off.}
+
+  when not defined(nimPreviewSlimSystem):
+    import std/sysatomics
+    export sysatomics
+  else:
+    import std/sysatomics
 
-  proc atomicDec*(memLoc: var int, x: int = 1): int {.inline,
-                                                     discardable, raises: [], tags: [], benign.}
-  ## Atomic decrement of `memLoc`. Returns the value after the operation.
+  {.pop.}
 
 include "system/memalloc"
 
@@ -1617,13 +1619,6 @@ when not defined(nimscript):
 when not declared(sysFatal):
   include "system/fatal"
 
-when not defined(nimscript):
-  {.push stackTrace: off, profiler: off.}
-
-  include "system/atomics"
-
-  {.pop.}
-
 
 when defined(nimV2):
   include system/arc