-
Notifications
You must be signed in to change notification settings - Fork 708
feat: Add jsi::ArrayBuffer::getMutableBuffer()
#1733
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
base: main
Are you sure you want to change the base?
Conversation
sry for the messy commit history, I was testing in CI until I figured out how to build the test suite locally, lol |
@tmikov do we need an implementation for |
Why not just implement the Immutable ArrayBuffers proposal? |
|
Thanks for the clarification. I had not understood that. |
Summary
Adds a new API to
jsi::ArrayBuffer
:getMutableBuffer()
- which returns astd::shared_ptr<MutableBuffer>
if it carries one (external buffer, held inInternalPropertyArrayBufferExternalFinalizer
), ornullptr
otherwise.I needed this in Nitro to efficiently pass native buffers between JS and native, and back.
Before this API, I lost all native buffer information if it was passed native -> JS -> native again.
Test Plan
(haven't tested this yet, trying to figure out how you guys run tests in hermes)