Files
node/doc/api
Gabriel Schulhof cf0e881b33 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-12 22:37:42 -04:00
..
2018-09-07 22:42:08 +01:00
2018-09-02 18:14:23 +02:00
2018-07-15 23:57:35 +03:00
2018-07-15 23:57:35 +03:00
2018-09-06 23:57:43 +02:00
2018-07-14 22:57:03 +03:00
2018-09-12 22:37:42 -04:00
2018-09-06 23:57:43 +02:00
2018-07-14 22:57:03 +03:00
2018-05-02 06:17:08 +03:00
2018-07-14 22:57:03 +03:00
2018-07-15 23:57:35 +03:00
2018-09-07 16:55:44 -07:00
2018-09-05 20:53:59 +02:00
2018-09-03 17:47:28 +03:00
2018-09-06 23:57:43 +02:00