-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory<T>
to TypedArray<T>
on Electron 19.1.9 Worked fine. But did not worked on higher Electron
#383
Comments
electron/electron#35801 appears to be quite a controversial issue, but the Electron team seems to believe the limitation is necessary for security. As a workaround, node-api-dotnet probably will need to handle the new |
I was aware about the change, but forgot to bring it to our discussion since we did not discuss the Electron integration. |
Is there a workaround for this issue at the moment? Would it be possible to construct an |
I found a workaround by constructing a Memory<T> source = ...
JSTypedArray<T> destination = new JSTypedArray<T>(source.Length);
source.CopyTo(destionation.Memory); |
I think this is a good solution for now. |
I Test
Memory<T>
toTypedArray<T>
on Electron 19.1.9,That Worked fine and has amazing Performance.But when I Test on higher Electron, such as 32.1.2, it was not worked. And reported an error:
External buffers are not allowed: Error in CreateExternalArrayBuffer at D:\a\1\s\src\NodeApi\JSValue.cs:264
I did some research,the use of External buffers has actually been officially banned.
electron/electron#35801
Does anyone know how to turn on External buffers support in the new version of Electron? Like turn it on by some command parameter or something。
Or has any Other way to transfer big data(such as 100MB) from dotnet to nodejs?
Originally posted by @Hiwen in #15 (comment)
The text was updated successfully, but these errors were encountered: