Skip to content

Commit

Permalink
[std/tasks] more gcsafe stuffs [backport] (#18926)
Browse files Browse the repository at this point in the history
  • Loading branch information
ringabout authored Sep 30, 2021
1 parent f35e9a5 commit 6bb32da
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/std/tasks.nim
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ type
Task* = object ## `Task` contains the callback and its arguments.
callback: proc (args: pointer) {.nimcall, gcsafe.}
args: pointer
destroy: proc (args: pointer) {.nimcall.}
destroy: proc (args: pointer) {.nimcall, gcsafe.}


proc `=copy`*(x: var Task, y: Task) {.error.}

proc `=destroy`*(t: var Task) {.inline.} =
proc `=destroy`*(t: var Task) {.inline, gcsafe.} =
## Frees the resources allocated for a `Task`.
if t.args != nil:
if t.destroy != nil:
Expand Down Expand Up @@ -219,7 +219,7 @@ macro toTask*(e: typed{nkCall | nkInfix | nkPrefix | nkPostfix | nkCommand | nkC
let `objTemp` = cast[ptr `scratchObjType`](args)
`functionStmtList`

proc `destroyName`(args: pointer) {.nimcall.} =
proc `destroyName`(args: pointer) {.gcsafe, nimcall.} =
let `objTemp2` = cast[ptr `scratchObjType`](args)
`tempNode`

Expand Down

0 comments on commit 6bb32da

Please sign in to comment.