node-ffi-napi / ref-napi

Turn Buffer instances into "pointers"
MIT License
123 stars 67 forks source link

Suggested Update to complete performance improvement fix #76

Open ggryschuk opened 2 years ago

ggryschuk commented 2 years ago

Hi. I've opened a new issue to submit the results of an update I've made to ref-napi to (hopefully) finalize the fix to performance started here #72. See my comments there in regards to an update needed to ReadPointer to account for needing to return a 1-length pointer. Specifically the following code needs to be added the 'reinterpret_cast',

if(val != nullPtr && size == 0) size = 1;

With this update made ref-napi will pass all it's mocha tests.

Importantly I've been able to identify the relatively simple updates needed to be made to ffi-napi to make it compatible with an updated ref-napi with these fixes. I will be posting my findings regarding ffi-napi over on the ffi-napi issues list.

Thanks.

ggryschuk commented 2 years ago

My apologies that should read "...to be added AFTER the 'reinterpret_cast'.