-
Notifications
You must be signed in to change notification settings - Fork 78
Node.js native module programming
bellbind edited this page Oct 13, 2013
·
11 revisions
- Application codes should be removed any node.js and v8 related definitions.
- it can use another languages for application code. e.g. C, Objective-C
- Node.js plug codes are almost for convert arguments and result.
3 Handle (smart pointer) type exists
-
Handle: as smart pointer of RAII (release the holding resource by its destructor) -
Local: automatically managed byHandleScope -
Persistent: explicitly call Dispose() to release
HandleScope instance is stacked memory manager for Local handle.
-
return scope.Close(localHandle): unmanage alocalHandleobject on thescope, then returnlocalHandleasHandle