Hello,

I'm trying to get V8 to work as part of an Android app with some native 
components as hidden properties whenever I construct the JS object. What 
seems like the right way is to create a Handle<External> and initialize it 
with, for example a pointer to the native component and SetHiddenProperty 
with that handle. However, I'm trying to find a way to release the 
resources taken by the External in the v8 host. Something like a "finalize" 
callback. One candidate was SetWeak on a Persistent<External> which has 
been shown to only actually execute the callback when v8 actually runs out 
of memory. The other approach was to run a separate thread that 
periodically runs a PersistentHandleVisitor and checks if a handle 
IsWeak(). However, that seems like a crude way of doing it.

Is there really an idiomatic way within v8 to handle External value 
finalization? There seems to be a consensus on the lack of support for this 
for high performance reasons, but there are some cases that require it for 
consistency purposes and from the host's perspective, for high performance 
as well.

Thanks!
~W

-- 
-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to