nodejs / abi-stable-node

Repository used by the Node-API team to manage work related to Node-API and node-addon-api
239 stars 47 forks source link

API for creating SharedArrayBuffer is missing #323

Closed primeare closed 2 years ago

primeare commented 6 years ago

There is no API for creating SharedArrayBuffer. As node.green says the support of SharedArrayBuffer was introduced since Node v9. I think this API was not introduced, because N-API has a backward compatibility with Node v8, where there is no support for SharedArrayBuffer. Please, let me know what is the reason and whether this could be implemented.

mhdawson commented 6 years ago

The API was built by looking at existing modules and focussing on what they needed. We want to keep the API as small as feasible while covering the common use cases. SharedArrayBuffer not being available until more recently would not have been in the set of commonly used functions by modules.

Are you working on a native module where you need to create a SharedArrayBuffer? Today you could do it by calling into JavaScript, create it there and then return it to the native.

mhdawson commented 2 years ago

Closing since there has not been a response for quite some time. Please let us know if you think that was not the right thing to do.