Re: How do I trace objects on the heap with JS 59

James Stortz <[email protected]> Thu, 9 Aug 2018 23:44:53 -0400
Newsgroups gmane.comp.mozilla.devel.jseng
Message-ID <CAE0WHd-UaSdqbVjGmDw4j5_ohpJv1t8Y_6i+aELyXQRcT8sSww@mail.gmail.com>
I'd like to add a question on this topic.

What if I have JSObjects that are already rooted? (Either as global
variables, or properties of rooted objects) And I have references to those
JSObject* pointers in my backend?

Do I need to change those JSObject* pointers to JS::Heap<JSObject*> in that
case? I always assumed that would be the case, but does it affect those
rooted JSObjects? Are they still the same object? If so, how do I convert
Heap<T> back to Rooted<T>?

I am a little confused. Do I need to call some kind of GC tracer API on
construction/deconstruction of my backend objects?

Thanks,
James