-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Open
Labels
Milestone
Description
Under wasm64 pointer types (and long and size_t) get passed as BigInt.
This means that EM_JS functions that take or return pointers will most likely need modifications (since BigInt and Number in JS are not generally compatible).
Should we try to find a way to avoid this type of thing:
EM_JS(char*, return_ptr, (void), {
#if __wasm64__
return BigInt(addressAsNumber);
#else
return addressAsNumber;
#endif
});
For JS library functions have use the __sig
metadata to encode certain arguments and return values are being "pointers" which means that get cooerced to Number/int53 in the JS glue code.
Should we do that same for EM_JS?