1
0
mirror of https://github.com/janet-lang/janet synced 2025-12-12 19:48:07 +00:00

Add JANET_MARSH_UNSAFE flag.

This allows unmarshal to optional marshal raw
pointers and cfunctions and send them across threads.
This flag is only exposed in the C API as it is very easy
to misuse and cause segfaults.
This commit is contained in:
Calvin Rose
2020-04-19 10:55:00 -05:00
parent 122c77dbf6
commit 5054eb4276
3 changed files with 60 additions and 4 deletions

View File

@@ -1310,6 +1310,8 @@ typedef JanetBuildConfig(*JanetModconf)(void);
JANET_API JanetModule janet_native(const char *name, JanetString *error);
/* Marshaling */
#define JANET_MARSHAL_UNSAFE 0x20000
JANET_API void janet_marshal(
JanetBuffer *buf,
Janet x,