mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 18:02:05 +00:00
ORC: API extensions for 1.4 (#15581)
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user