diff options
author | flywind <xzsflywind@gmail.com> | 2021-09-30 13:46:30 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-30 07:46:30 +0200 |
commit | 6bb32da4aecbe80a9cc0cce90322c0e741ee8b85 (patch) | |
tree | 5030d9ea78d7cf658dcac0dcf878311e68b624e8 /lib/std/tasks.nim | |
parent | f35e9a5752bb4cd4e30105cd27b6bc56cbf22329 (diff) | |
download | Nim-6bb32da4aecbe80a9cc0cce90322c0e741ee8b85.tar.gz |
[std/tasks] more gcsafe stuffs [backport] (#18926)
Diffstat (limited to 'lib/std/tasks.nim')
-rw-r--r-- | lib/std/tasks.nim | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/std/tasks.nim b/lib/std/tasks.nim index 97c4df3f7..e2ea5377f 100644 --- a/lib/std/tasks.nim +++ b/lib/std/tasks.nim @@ -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: @@ -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` |