attempt to fix #4640

This commit is contained in:
Andreas Rumpf 2016-09-13 13:18:17 +02:00
commit 03768e7da0
3 changed files with 9 additions and 6 deletions

View file

@ -11,7 +11,8 @@
# use the heap (and nor exceptions) do not include the GC or memory allocator.
var
errorMessageWriter*: (proc(msg: string) {.tags: [WriteIOEffect], benign.})
errorMessageWriter*: (proc(msg: string) {.tags: [WriteIOEffect], benign,
nimcall.})
## Function that will be called
## instead of stdmsg.write when printing stacktrace.
## Unstable API.
@ -26,7 +27,7 @@ else:
proc writeToStdErr(msg: cstring) =
discard MessageBoxA(0, msg, nil, 0)
proc showErrorMessage(data: cstring) =
proc showErrorMessage(data: cstring) {.gcsafe.} =
if errorMessageWriter != nil:
errorMessageWriter($data)
else:

View file

@ -331,7 +331,9 @@ else:
when TArg is void:
thrd.dataFn()
else:
thrd.dataFn(thrd.data)
var x: TArg
deepCopy(x, thrd.data)
thrd.dataFn(x)
proc threadProcWrapStackFrame[TArg](thrd: ptr Thread[TArg]) =
when defined(boehmgc):