On Sat, Feb 24, 2018 at 11:20 PM, A.M. <cis74...@gmail.com> wrote:
> My understanding is that garbage collection can be done either in the idle
> notification call made by the application or when some context is being
> disposed of or in one of the v8 background threads. I'm not concerned about
> phantom handles and the foreground message pump.
>
> Can somebody confirm that if (a) no script is running (i.e. not in
> `v8::Script::Compile` nor in `v8::Script::Run`) and (b) no weak  pointers
> are set by the application, then none of the application object callbacks
> will be called?
>
> The context for this question is that I would like to destroy application
> objects set in the internal fields of v8 objects and hope that after
> `v8::Script::Run` returns, I can destroy all application-allocated resources
> without having to reset all v8 internal fields pointing to these objects,
> regardless whether the GC cycle is about to run, or is running in another
> thread or will run in the near future.
>
> Thanks!

The answer is "it depends."  If you're not going to call into V8 at
all it's _probably_ safe but most V8 APIs can kick off a GC run.  Call
`v8::Isolate::Dispose()` first to be safe.

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
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 v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to