worker: add public method for marking objects as untransferable
We currently mark a number of ArrayBuffer
s as not transferable,
including the Buffer
pool and ones with finalizers provided
by C++ addons.
There is no good reason to assume that userland code might not
encounter similar problems, for example when doing ArrayBuffer
pooling similar to ours. Therefore, provide an API that lets
userland code also mark objects as not transferable.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines