diff options
author | ringabout <43030857+ringabout@users.noreply.github.com> | 2023-08-08 17:55:18 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-08 05:55:18 -0400 |
commit | 10a6e4c236b8d4d609a07b29ad5b7b4e517cd367 (patch) | |
tree | 67bdc6e014432b6edf9578829b5649eb03490c23 | |
parent | bf5d173bc65aea071e5ffdf593f6b8797b56816d (diff) | |
download | Nim-10a6e4c236b8d4d609a07b29ad5b7b4e517cd367.tar.gz |
clean up `gc:arc` or `gc:orc` in docs and in error messages (#22408)
* clean up gc:arc/orc in docs * in error messages
-rw-r--r-- | compiler/ccgexprs.nim | 2 | ||||
-rw-r--r-- | lib/std/tasks.nim | 4 | ||||
-rw-r--r-- | lib/system.nim | 4 | ||||
-rw-r--r-- | lib/system/arc.nim | 6 | ||||
-rw-r--r-- | lib/system/orc.nim | 10 | ||||
-rw-r--r-- | lib/system/osalloc.nim | 2 |
6 files changed, 14 insertions, 14 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim index cc0d0465c..f1de6f757 100644 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -2621,7 +2621,7 @@ proc genMagicExpr(p: BProc, e: PNode, d: var TLoc, op: TMagic) = of mDeepCopy: if p.config.selectedGC in {gcArc, gcAtomicArc, gcOrc} and optEnableDeepCopy notin p.config.globalOptions: localError(p.config, e.info, - "for --gc:arc|orc 'deepcopy' support has to be enabled with --deepcopy:on") + "for --mm:arc|atomicArc|orc 'deepcopy' support has to be enabled with --deepcopy:on") var a, b: TLoc = default(TLoc) let x = if e[1].kind in {nkAddr, nkHiddenAddr}: e[1][0] else: e[1] diff --git a/lib/std/tasks.nim b/lib/std/tasks.nim index 923cb2e99..6a4b2bb6d 100644 --- a/lib/std/tasks.nim +++ b/lib/std/tasks.nim @@ -111,7 +111,7 @@ template addAllNode(assignParam: NimNode, procParam: NimNode) = macro toTask*(e: typed{nkCall | nkInfix | nkPrefix | nkPostfix | nkCommand | nkCallStrLit}): Task = ## Converts the call and its arguments to `Task`. - runnableExamples("--gc:orc"): + runnableExamples: proc hello(a: int) = echo a let b = toTask hello(13) @@ -259,7 +259,7 @@ macro toTask*(e: typed{nkCall | nkInfix | nkPrefix | nkPostfix | nkCommand | nkC when defined(nimTasksDebug): echo result.repr -runnableExamples("--gc:orc"): +runnableExamples: block: var num = 0 proc hello(a: int) = inc num, a diff --git a/lib/system.nim b/lib/system.nim index 1bf1c5ccb..3076fe2fd 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -2565,7 +2565,7 @@ when hasAlloc and notJSnotNims: ## This is also used by the code generator ## for the implementation of `spawn`. ## - ## For `--gc:arc` or `--gc:orc` deepcopy support has to be enabled + ## For `--mm:arc` or `--mm:orc` deepcopy support has to be enabled ## via `--deepcopy:on`. discard @@ -2811,7 +2811,7 @@ when notJSnotNims and not defined(nimSeqsV2): ## String literals (e.g. "abc", etc) in the ARC/ORC mode are "copy on write", ## therefore you should call `prepareMutation` before modifying the strings ## via `addr`. - runnableExamples("--gc:arc"): + runnableExamples: var x = "abc" var y = "defgh" prepareMutation(y) # without this, you may get a `SIGBUS` or `SIGSEGV` diff --git a/lib/system/arc.nim b/lib/system/arc.nim index b264cbedd..0624bd4e3 100644 --- a/lib/system/arc.nim +++ b/lib/system/arc.nim @@ -223,15 +223,15 @@ proc GC_ref*[T](x: ref T) = when not defined(gcOrc): template GC_fullCollect* = - ## Forces a full garbage collection pass. With `--gc:arc` a nop. + ## Forces a full garbage collection pass. With `--mm:arc` a nop. discard template setupForeignThreadGc* = - ## With `--gc:arc` a nop. + ## With `--mm:arc` a nop. discard template tearDownForeignThreadGc* = - ## With `--gc:arc` a nop. + ## With `--mm:arc` a nop. discard proc isObjDisplayCheck(source: PNimTypeV2, targetDepth: int16, token: uint32): bool {.compilerRtl, inl.} = diff --git a/lib/system/orc.nim b/lib/system/orc.nim index b7b98c340..335d49d0f 100644 --- a/lib/system/orc.nim +++ b/lib/system/orc.nim @@ -424,13 +424,13 @@ proc GC_runOrc* = orcAssert roots.len == 0, "roots not empty!" proc GC_enableOrc*() = - ## Enables the cycle collector subsystem of `--gc:orc`. This is a `--gc:orc` + ## Enables the cycle collector subsystem of `--mm:orc`. This is a `--mm:orc` ## specific API. Check with `when defined(gcOrc)` for its existence. when not defined(nimStressOrc): rootsThreshold = 0 proc GC_disableOrc*() = - ## Disables the cycle collector subsystem of `--gc:orc`. This is a `--gc:orc` + ## Disables the cycle collector subsystem of `--mm:orc`. This is a `--mm:orc` ## specific API. Check with `when defined(gcOrc)` for its existence. when not defined(nimStressOrc): rootsThreshold = high(int) @@ -441,16 +441,16 @@ proc GC_partialCollect*(limit: int) = partialCollect(limit) proc GC_fullCollect* = - ## Forces a full garbage collection pass. With `--gc:orc` triggers the cycle + ## Forces a full garbage collection pass. With `--mm:orc` triggers the cycle ## collector. This is an alias for `GC_runOrc`. collectCycles() proc GC_enableMarkAndSweep*() = - ## For `--gc:orc` an alias for `GC_enableOrc`. + ## For `--mm:orc` an alias for `GC_enableOrc`. GC_enableOrc() proc GC_disableMarkAndSweep*() = - ## For `--gc:orc` an alias for `GC_disableOrc`. + ## For `--mm:orc` an alias for `GC_disableOrc`. GC_disableOrc() const diff --git a/lib/system/osalloc.nim b/lib/system/osalloc.nim index 201be8540..5509d0070 100644 --- a/lib/system/osalloc.nim +++ b/lib/system/osalloc.nim @@ -30,7 +30,7 @@ const doNotUnmap = not (defined(amd64) or defined(i386)) or when defined(nimAllocPagesViaMalloc): when not defined(gcArc) and not defined(gcOrc) and not defined(gcAtomicArc): - {.error: "-d:nimAllocPagesViaMalloc is only supported with --gc:arc or --gc:orc".} + {.error: "-d:nimAllocPagesViaMalloc is only supported with --mm:arc or --mm:atomicArc or --mm:orc".} proc osTryAllocPages(size: int): pointer {.inline.} = let base = c_malloc(csize_t size + PageSize - 1 + sizeof(uint32)) |