(When) are HandleScopes (still) necessary in native node.js addons? -
in node.js v6.4.0 documentation on addons, functions adhere following pattern.
void x(const functioncallbackinfo<value>& args) { isolate* isolate = args.getisolate(); ... }
so there no instantiation of handlescope
, there used in prior versions of node.js. there's 1 exception, handlescope scope(isolate)
done.
most of functions instantiate local<...>
handles, i'd expect handlescope necessary garbage collection done on function return.
so: when handlescopes necessary in node.js 6.4.0 native addons?
in general not need handlescope
if calling function javascript. because there (parent) scope inherited javascript call site. javascript scope gets garbage collected, handles created in c++ collected because they're attached scope.
so adding handlescope
every function won't hurt anything, it's may impact performance some.
Comments
Post a Comment