diff --git a/lib/system/arc.nim b/lib/system/arc.nim index d67af9817a..adf1d833a1 100644 --- a/lib/system/arc.nim +++ b/lib/system/arc.nim @@ -14,6 +14,8 @@ at offset 0 then. The ``ref`` object header is independent from the runtime type and only contains a reference count. ]# +{.push raises: [].} + when defined(gcOrc): const rcIncrement = 0b10000 # so that lowest 4 bits are not touched @@ -269,3 +271,5 @@ when defined(gcDestructors): proc nimGetVTable(p: pointer, index: int): pointer {.compilerRtl, inline, raises: [].} = result = cast[ptr PNimTypeV2](p).vTable[index] + +{.pop.} # raises: [] diff --git a/lib/system/cyclebreaker.nim b/lib/system/cyclebreaker.nim index 45b0a5a650..d611322d96 100644 --- a/lib/system/cyclebreaker.nim +++ b/lib/system/cyclebreaker.nim @@ -62,8 +62,8 @@ const colorMask = 0b011 type - TraceProc = proc (p, env: pointer) {.nimcall, benign.} - DisposeProc = proc (p: pointer) {.nimcall, benign.} + TraceProc = proc (p, env: pointer) {.nimcall, benign, raises: [].} + DisposeProc = proc (p: pointer) {.nimcall, benign, raises: [].} template color(c): untyped = c.rc and colorMask template setColor(c, col) = diff --git a/lib/system/gc.nim b/lib/system/gc.nim index e1de2aade7..1c28294e73 100644 --- a/lib/system/gc.nim +++ b/lib/system/gc.nim @@ -62,6 +62,7 @@ comparisons). ]# {.push profiler:off.} +{.push raises: [].} const CycleIncrease = 2 # is a multiplicative increase @@ -914,4 +915,5 @@ when not defined(useNimRtl): result.add "[GC] stack bottom: " & gch.stack.bottom.repr result.add "[GC] max stack size: " & $gch.stat.maxStackSize & "\n" +{.pop.} # raises: [] {.pop.} # profiler: off, stackTrace: off diff --git a/lib/system/gc_interface.nim b/lib/system/gc_interface.nim index 84145f33a9..4540db21f2 100644 --- a/lib/system/gc_interface.nim +++ b/lib/system/gc_interface.nim @@ -25,33 +25,33 @@ when hasAlloc and not defined(js) and not usesDestructors: proc GC_enable*() {.rtl, inl, benign, raises: [].} ## Enables the GC again. - proc GC_fullCollect*() {.rtl, benign.} + proc GC_fullCollect*() {.rtl, benign, raises: [].} ## Forces a full garbage collection pass. ## Ordinary code does not need to call this (and should not). - proc GC_enableMarkAndSweep*() {.rtl, benign.} - proc GC_disableMarkAndSweep*() {.rtl, benign.} + proc GC_enableMarkAndSweep*() {.rtl, benign, raises: [].} + proc GC_disableMarkAndSweep*() {.rtl, benign, raises: [].} ## The current implementation uses a reference counting garbage collector ## with a seldomly run mark and sweep phase to free cycles. The mark and ## sweep phase may take a long time and is not needed if the application ## does not create cycles. Thus the mark and sweep phase can be deactivated ## and activated separately from the rest of the GC. - proc GC_getStatistics*(): string {.rtl, benign.} + proc GC_getStatistics*(): string {.rtl, benign, raises: [].} ## Returns an informative string about the GC's activity. This may be useful ## for tweaking. - proc GC_ref*[T](x: ref T) {.magic: "GCref", benign.} - proc GC_ref*[T](x: seq[T]) {.magic: "GCref", benign.} - proc GC_ref*(x: string) {.magic: "GCref", benign.} + proc GC_ref*[T](x: ref T) {.magic: "GCref", benign, raises: [].} + proc GC_ref*[T](x: seq[T]) {.magic: "GCref", benign, raises: [].} + proc GC_ref*(x: string) {.magic: "GCref", benign, raises: [].} ## Marks the object `x` as referenced, so that it will not be freed until ## it is unmarked via `GC_unref`. ## If called n-times for the same object `x`, ## n calls to `GC_unref` are needed to unmark `x`. - proc GC_unref*[T](x: ref T) {.magic: "GCunref", benign.} - proc GC_unref*[T](x: seq[T]) {.magic: "GCunref", benign.} - proc GC_unref*(x: string) {.magic: "GCunref", benign.} + proc GC_unref*[T](x: ref T) {.magic: "GCunref", benign, raises: [].} + proc GC_unref*[T](x: seq[T]) {.magic: "GCunref", benign, raises: [].} + proc GC_unref*(x: string) {.magic: "GCunref", benign, raises: [].} ## See the documentation of `GC_ref <#GC_ref,string>`_. proc nimGC_setStackBottom*(theStackBottom: pointer) {.compilerRtl, noinline, benign, raises: [].} diff --git a/lib/system/orc.nim b/lib/system/orc.nim index 73b68bb9d2..8027e1abdc 100644 --- a/lib/system/orc.nim +++ b/lib/system/orc.nim @@ -14,6 +14,8 @@ # R.D. Lins / Information Processing Letters 109 (2008) 71–78 # +{.push raises: [].} + include cellseqs_v2 const @@ -27,8 +29,8 @@ const logOrc = defined(nimArcIds) type - TraceProc = proc (p, env: pointer) {.nimcall, benign.} - DisposeProc = proc (p: pointer) {.nimcall, benign.} + TraceProc = proc (p, env: pointer) {.nimcall, benign, raises: [].} + DisposeProc = proc (p: pointer) {.nimcall, benign, raises: [].} template color(c): untyped = c.rc and colorMask template setColor(c, col) = @@ -545,3 +547,5 @@ proc nimDecRefIsLastCyclicStatic(p: pointer; desc: PNimTypeV2): bool {.compilerR dec cell.rc, rcIncrement #if cell.color == colPurple: rememberCycle(result, cell, desc) + +{.pop.} # raises: []