1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-21 18:57:41 +00:00

Use _setjmp/_longjmp on BSDs.

This doesn't save the signal mask so should be a bit faster.
This commit is contained in:
Calvin Rose
2019-12-18 12:11:18 -05:00
parent 8cc43ad2d1
commit 4238379552
3 changed files with 23 additions and 3 deletions

View File

@@ -29,7 +29,11 @@
void janet_panicv(Janet message) {
if (janet_vm_return_reg != NULL) {
*janet_vm_return_reg = message;
#if defined(JANET_BSD) || defined(JANET_APPLE)
_longjmp(*janet_vm_jmp_buf, 1);
#else
longjmp(*janet_vm_jmp_buf, 1);
#endif
} else {
fputs((const char *)janet_formatc("janet top level panic - %v\n", message), stdout);
exit(1);