Files
node/doc
Gabriel Schulhof bb2bbc8ebe n-api: add generic finalizer callback
Add `napi_add_finalizer()`, which provides the ability to attach data
to an arbitrary object and be notified when that object is garbage-
collected so as to have an opportunity to delete the data previously
attached.

This differs from `napi_wrap()` in that it does not use up the private
slot on the object, and is therefore neither removable, nor retrievable
after the call to `napi_add_finalizer()`. It is assumed that the data
is accessible by other means, yet it must be tied to the lifetime of
the object. This is the case for data passed to a dynamically created
function which is itself heap-allocated and must therefore be freed
along with the function.

Fixes: https://github.com/nodejs/abi-stable-node/issues/313
PR-URL: https://github.com/nodejs/node/pull/22244
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2018-09-20 07:41:15 +02:00
..
2018-09-20 07:41:15 +02:00
2018-09-06 08:53:57 +02:00
2018-09-07 20:38:45 +02:00
2018-06-06 10:33:35 +02:00
2018-07-31 09:35:46 +02:00
2018-07-14 12:03:01 +02:00