summary refs log tree commit diff stats
path: root/lib/system
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2020-10-15 11:51:40 +0200
committerGitHub <noreply@github.com>2020-10-15 11:51:40 +0200
commitfd9ab2ce6d3721545bec0d43c3e862eb3b458feb (patch)
tree0e59c2b04bdaf8731cebf9debc97a525e63b1292 /lib/system
parent1bbc20010e3c8efc0de2c73a8d0d3d844de97049 (diff)
downloadNim-fd9ab2ce6d3721545bec0d43c3e862eb3b458feb.tar.gz
ORC: API extensions for 1.4 (#15581)
Diffstat (limited to 'lib/system')
-rw-r--r--lib/system/orc.nim27
1 files changed, 22 insertions, 5 deletions
diff --git a/lib/system/orc.nim b/lib/system/orc.nim
index 1d856696c..3c2327fd5 100644
--- a/lib/system/orc.nim
+++ b/lib/system/orc.nim
@@ -349,19 +349,36 @@ proc registerCycle(s: Cell; desc: PNimTypeV2) =
     collectCycles()
   #writeCell("[added root]", s)
 
-proc GC_fullCollect* =
-  ## Forces a full garbage collection pass. With ``--gc:orc`` triggers the cycle
-  ## collector.
+proc GC_runOrc* =
+  ## Forces a cycle collection pass.
   collectCycles()
 
-proc GC_enableMarkAndSweep*() =
+proc GC_enableOrc*() =
+  ## Enables the cycle collector subsystem of ``--gc:orc``. This is a ``--gc:orc``
+  ## specific API. Check with ``when defined(gcOrc)`` for its existence.
   when not defined(nimStressOrc):
     rootsThreshold = defaultThreshold
 
-proc GC_disableMarkAndSweep*() =
+proc GC_disableOrc*() =
+  ## Disables the cycle collector subsystem of ``--gc:orc``. This is a ``--gc:orc``
+  ## specific API. Check with ``when defined(gcOrc)`` for its existence.
   when not defined(nimStressOrc):
     rootsThreshold = high(int)
 
+
+proc GC_fullCollect* =
+  ## Forces a full garbage collection pass. With ``--gc:orc`` triggers the cycle
+  ## collector. This is an alias for ``GC_runOrc``.
+  collectCycles()
+
+proc GC_enableMarkAndSweep*() =
+  ## For ``--gc:orc`` an alias for ``GC_enableOrc``.
+  GC_enableOrc()
+
+proc GC_disableMarkAndSweep*() =
+  ## For ``--gc:orc`` an alias for ``GC_disableOrc``.
+  GC_disableOrc()
+
 proc rememberCycle(isDestroyAction: bool; s: Cell; desc: PNimTypeV2) {.noinline.} =
   if isDestroyAction:
     if (s.rc and isCycleCandidate) != 0: