-
Notifications
You must be signed in to change notification settings - Fork 167
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
Problem using JSTypedArray #37
Comments
Sounds like this might be a bug in this JSC version. The JSC version here is now more than 3 years old - I would advise against using it. Is there any reason why you can't use the JSC version that comes with iOS? |
Thanks for your response, I was exactly using the bundled So I wonder if you happens to encountered into the same problem when using embed JSC in |
Well, if this problem occurs with the current, stable JSC version, I would assume it's either a bug in your code or some very specific use case/interaction with other APIs. Otherwise lots of other people would have encountered this problem. So, no, I have not encountered this problem. But I may be able to help if you can share your code. |
Thanks, actually I still cannot reproduce it with very simple code, it only happens in cases of a large quantity of js codes. But I'd let you know if there being any progress. |
Just wanna let you know that after a period of digging into such weird cases, We figured out that the reason might be that, jsc processes micro tasks inappropriately. When a native call occurs, such as calling a user-defined native function callback, or accessing typed array elms, it triggers pending micro tasks and some unexpected callbacks is called before the native callbacks run. And if the callback, such as a |
Hello, I ran into a problem using JSTypedArray and was wondering if you could give me some help.
I read through the blog here and figured it out it could not solve my problem, but wondering if you might have ran into the same problem. I used an
ArrayBuffer
to transfer large amount of data from js to C, but the result is sometimes wrong. When I set a value in js, the underlying memory is untouched. for exampleIt happens randomly, cannot be reproduced every time. The key is that when I made a native call, such as passing the TypedArray object into a native function, or calling
toString
of the typed array, the array then acts normally. Even if the native function does nothing with the array (such asJSObjectGetTypedArrayBytesPtr
).I sincerely hope that you could give some guidance about how to avoid this bug, many thanks.
The text was updated successfully, but these errors were encountered: