Implementation of V1 buffer runtime functions#168
Conversation
|
| console.log(addon.newBuffer().toLocaleString(), addon.theText); | ||
| console.log("gc1"); | ||
| console.log(addon.getDeleterCallCount(), 0); | ||
| global.gc(); |
There was a problem hiding this comment.
I don't expect this to be defined when running in React Native.
There was a problem hiding this comment.
From what I can see Hermes C++ API does not provide a way to trigger a garbage collection. I think without patching the Hermes it won't be possible to run this part of test when running in React Native - please correct me if I am wrong. In this case I will remove it for now.
There was a problem hiding this comment.
Turns out I was wrong 🎉 globalThis.gc() should be available 🦾
|
@paradowstack when you're ready to run the tests on Android and iOS you can add the two labels to the PR (not yet well documented). I just did this now, hope that's okay with you 🙏 |
There was a problem hiding this comment.
I think it's okay to merge once the Android and iOS tests has passed and look forward to improving the tests with #147.
This PR brings in an implementation of following
V1buffer runtime functions:napi_create_buffernapi_create_buffer_copynapi_is_buffernapi_get_buffer_infonapi_create_external_bufferIt also introduces test addon, adopted from https://github.com/nodejs/node/tree/main/test/node-api/test_buffer, that is placed in
packages/node-addon-examples/tests/buffers.