Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing HandleScopes #2

Closed
ryancole opened this issue Jan 15, 2013 · 1 comment
Closed

Missing HandleScopes #2

ryancole opened this issue Jan 15, 2013 · 1 comment

Comments

@ryancole
Copy link

I've only written a few node addons, so I may be wrong, but shouldn't you be creating a HandleScope in any function that uses v8 classes? You export a few functions to JS land that do not contain one. Is this valid safe because of the HandleScope you create in the init function?

@lloyd lloyd closed this as completed in 9d1fdcc Jan 17, 2013
@lloyd
Copy link
Owner

lloyd commented Jan 17, 2013

Yo @ryancole - My understanding is that usage of HandleScopes can minimize the lifetime of allocated objects. Because in the two functions in question we're not allocating any handles which reference objects on the heap, and are just returning primitives, it's my belief that a HandleScope would be counter-productive.

Admittedly, this optimization is probably meaningless - I documented my understanding of why we don't need handlescopes in the couple functions in question in code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants