Yrc typos and omissions (#25500)

This commit is contained in:
Andreas Rumpf
2026-02-10 13:21:35 +01:00
committed by GitHub
parent a690a9ac90
commit f62669a5d5
28 changed files with 60 additions and 59 deletions

View File

@@ -188,7 +188,7 @@ proc processRequest(
# \n
request.headers.clear()
request.body = ""
when defined(gcArc) or defined(gcOrc) or defined(gcAtomicArc):
when defined(gcArc) or defined(gcOrc) or defined(gcAtomicArc) or defined(gcYrc):
request.hostname = address
else:
request.hostname.shallowCopy(address)

View File

@@ -36,7 +36,7 @@ when defined(nimPreviewSlimSystem):
import std/assertions
const defaultStackSize = 512 * 1024
const useOrcArc = defined(gcArc) or defined(gcOrc) or defined(gcAtomicArc)
const useOrcArc = defined(gcArc) or defined(gcOrc) or defined(gcAtomicArc) or defined(gcYrc)
when useOrcArc:
proc nimGC_setStackBottom*(theStackBottom: pointer) = discard

View File

@@ -866,7 +866,7 @@ proc parseJson(p: var JsonParser; rawIntegers, rawFloats: bool, depth = 0): Json
case p.tok
of tkString:
# we capture 'p.a' here, so we need to give it a fresh buffer afterwards:
when defined(gcArc) or defined(gcOrc) or defined(gcAtomicArc):
when defined(gcArc) or defined(gcOrc) or defined(gcAtomicArc) or defined(gcYrc):
result = JsonNode(kind: JString, str: move p.a)
else:
result = JsonNode(kind: JString)

View File

@@ -305,7 +305,7 @@ proc store*[T](s: Stream, data: sink T) =
var stored = initIntSet()
var d: T
when defined(gcArc) or defined(gcOrc)or defined(gcAtomicArc):
when defined(gcArc) or defined(gcOrc)or defined(gcAtomicArc) or defined(gcYrc):
d = data
else:
shallowCopy(d, data)
@@ -334,7 +334,7 @@ proc `$$`*[T](x: sink T): string =
else:
var stored = initIntSet()
var d: T
when defined(gcArc) or defined(gcOrc) or defined(gcAtomicArc):
when defined(gcArc) or defined(gcOrc) or defined(gcAtomicArc) or defined(gcYrc):
d = x
else:
shallowCopy(d, x)

View File

@@ -68,7 +68,7 @@ type
proc `=copy`*(x: var Task, y: Task) {.error.}
const arcLike = defined(gcArc) or defined(gcAtomicArc) or defined(gcOrc)
const arcLike = defined(gcArc) or defined(gcAtomicArc) or defined(gcOrc) or defined(gcYrc)
when defined(nimAllowNonVarDestructor) and arcLike:
proc `=destroy`*(t: Task) {.inline, gcsafe.} =
## Frees the resources allocated for a `Task`.

View File

@@ -9,13 +9,13 @@
##[
Thread support for Nim. Threads allow multiple functions to execute concurrently.
In Nim, threads are a low-level construct and using a library like `malebolgia`, `taskpools` or `weave` is recommended.
When creating a thread, you can pass arguments to it. As Nim's garbage collector does not use atomic references, sharing
`ref` and other variables managed by the garbage collector between threads is not supported.
Use global variables to do so, or pointers.
Memory allocated using [`sharedAlloc`](./system.html#allocShared.t%2CNatural) can be used and shared between threads.
To communicate between threads, consider using [channels](./system.html#Channel)
@@ -44,7 +44,7 @@ joinThreads(thr)
deinitLock(L)
```
When using a memory management strategy that supports shared heaps like `arc` or `boehm`,
you can pass pointer to threads and share memory between them, but the memory must outlive the thread.
The default memory management strategy, `orc`, supports this.
@@ -52,14 +52,14 @@ The example below is **not valid** for memory management strategies that use loc
```Nim
import locks
var l: Lock
proc threadFunc(obj: ptr seq[int]) {.thread.} =
withLock l:
for i in 0..<100:
obj[].add(obj[].len * obj[].len)
proc threadHandler() =
var thr: array[0..4, Thread[ptr seq[int]]]
var s = newSeq[int]()
@@ -68,7 +68,7 @@ proc threadHandler() =
createThread(thr[i], threadFunc, s.addr)
joinThreads(thr)
echo s
initLock(l)
threadHandler()
deinitLock(l)
@@ -303,5 +303,5 @@ else:
proc createThread*(t: var Thread[void], tp: proc () {.thread, nimcall.}) =
createThread[void](t, tp)
when not defined(gcOrc):
when not defined(gcOrc) and not defined(gcYrc):
include system/threadids

View File

@@ -25,7 +25,7 @@ when not (defined(cpu16) or defined(cpu8)):
bytes: int
data: WideCString
const arcLike = defined(gcArc) or defined(gcAtomicArc) or defined(gcOrc)
const arcLike = defined(gcArc) or defined(gcAtomicArc) or defined(gcOrc) or defined(gcYrc)
when defined(nimAllowNonVarDestructor) and arcLike:
proc `=destroy`(a: WideCStringObj) =
if a.data != nil:

View File

@@ -42,7 +42,7 @@ Complete traversal is done in this way::
]#
when defined(gcOrc) or defined(gcArc) or defined(gcAtomicArc):
when defined(gcOrc) or defined(gcArc) or defined(gcAtomicArc) or defined(gcYrc):
type
PCell = Cell
@@ -78,7 +78,7 @@ type
head: PPageDesc
data: PPageDescArray
when defined(gcOrc) or defined(gcArc) or defined(gcAtomicArc):
when defined(gcOrc) or defined(gcArc) or defined(gcAtomicArc) or defined(gcYrc):
discard
else:
include cellseqs_v1

View File

@@ -465,13 +465,13 @@ proc GC_runOrc* =
proc GC_enableOrc*() =
## Enables the cycle collector subsystem of `--mm:orc`. This is a `--mm:orc`
## specific API. Check with `when defined(gcOrc)` for its existence.
## specific API. Check with `when defined(gcOrc) or defined(gcYrc)` for its existence.
when not defined(nimStressOrc):
rootsThreshold = 0
proc GC_disableOrc*() =
## Disables the cycle collector subsystem of `--mm:orc`. This is a `--mm:orc`
## specific API. Check with `when defined(gcOrc)` for its existence.
## specific API. Check with `when defined(gcOrc) or defined(gcYrc)` for its existence.
when not defined(nimStressOrc):
rootsThreshold = high(int)

View File

@@ -31,8 +31,8 @@ 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 --mm:arc or --mm:atomicArc or --mm:orc".}
when not defined(gcArc) and not defined(gcOrc) and not defined(gcAtomicArc) and not defined(gcYrc):
{.error: "-d:nimAllocPagesViaMalloc is only supported with --mm:arc or --mm:atomicArc or --mm:orc or --mm:yrc".}
proc osTryAllocPages(size: int): pointer {.inline.} =
let base = c_malloc(csize_t size + PageSize - 1 + sizeof(uint32))

View File

@@ -159,8 +159,9 @@ proc GC_setPreventThreadFromCollectProc*(cb: PreventThreadFromCollectProc) =
GC_setPreventThreadFromCollectProc(proc(): bool {.nimcall.} =
if hardRealTimeThread == getThreadId():
writeStackTrace()
echo "Realtime thread involved in inpredictable cycle collector activity!"
echo "Realtime thread involved in unpredictable cycle collector activity!"
result = false
)
```
]##
gPreventThreadFromCollectProc = cb