Commit 29df1a87 authored by Gabriel Schulhof's avatar Gabriel Schulhof Committed by Michael Dawson
Browse files

N-API: Reuse ObjectTemplate instances

V8 caches and does not subsequently release `ObjectTemplate` instances.
Thus, we need to store the `ObjectTemplate` from which we derive object
instances we use for `napi_wrap()` and function/accessor context in a
persistent in the `napi_env`.

https://github.com/nodejs/node-addon-api/pull/70#discussion_r124998408

PR-URL: https://github.com/nodejs/node/pull/13999


Reviewed-By: default avatarBen Noordhuis <info@bnoordhuis.nl>
Reviewed-By: default avatarAnna Henningsen <anna@addaleax.net>
Reviewed-By: default avatarColin Ihrig <cjihrig@gmail.com>
Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarMichael Dawson <michael_dawson@ca.ibm.co>
Reviewed-By: default avatarHitesh Kanwathirtha <digitalinfinity@gmail.com>
parent f651e403
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment