mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-22 15:25:22 +00:00
fixes refc with non-var destructor; cancel warnings (#23156)
fixes https://forum.nim-lang.org/t/10807
This commit is contained in:
@@ -68,7 +68,8 @@ type
|
||||
|
||||
proc `=copy`*(x: var Task, y: Task) {.error.}
|
||||
|
||||
when defined(nimAllowNonVarDestructor):
|
||||
const arcLike = defined(gcArc) or defined(gcAtomicArc) or defined(gcOrc)
|
||||
when defined(nimAllowNonVarDestructor) and arcLike:
|
||||
proc `=destroy`*(t: Task) {.inline, gcsafe.} =
|
||||
## Frees the resources allocated for a `Task`.
|
||||
if t.args != nil:
|
||||
|
||||
@@ -25,7 +25,8 @@ when not (defined(cpu16) or defined(cpu8)):
|
||||
bytes: int
|
||||
data: WideCString
|
||||
|
||||
when defined(nimAllowNonVarDestructor):
|
||||
const arcLike = defined(gcArc) or defined(gcAtomicArc) or defined(gcOrc)
|
||||
when defined(nimAllowNonVarDestructor) and arcLike:
|
||||
proc `=destroy`(a: WideCStringObj) =
|
||||
if a.data != nil:
|
||||
when compileOption("threads"):
|
||||
|
||||
Reference in New Issue
Block a user