On Thu, Nov 28, 2013 at 4:15 AM, Hoping White <[email protected]> wrote:
> Thanks for the reply. Then any object which has > AlignedPointerInInternalField must be hold by myself and release by myself. > Is there any interceptor to do this? > So this can be easier with v8 gc. > You can use Persistent::SetWeak to register a callback for the containing object. This callback gets invoked when GC decides that the object is dead, but note that there is no guarantee when (and even if) this will happen, so conceptually it is best-effort only. In general, relying on such finalizer-like API is a recipe for pain, so don't do it, this has already been discussed in length in this list and in every other mailing list for languages with a finalizer-like API for decades. Include some explicit "free this resource" call in your API, and use the finalizer only as a last resort/fallback. -- -- 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/groups/opt_out.
