Re: How do I trace objects on the heap with JS 59
James Stortz <[email protected]> Mon, 27 Aug 2018 18:19:06 -0400
| Newsgroups | gmane.comp.mozilla.devel.jseng |
|---|---|
| Message-ID | <CAE0WHd8MofN-6k3t_E5d9DsCXJ-HXKRL2JSGS2qYu8EXO=fKTw@mail.gmail.com> |
On Mon, Aug 27, 2018 at 1:07 PM, Boris Zbarsky <[email protected]> wrote: > > [a] > Well, there's what Firefox does, which is having C++ objects trace their > JS objects as needed, etc, but breaking the cycles when the C++ object is > conceptually dead. > [b] > Sure, you can run a GC marking pass and see what color it ended up being. > [c] You can use the objectMovedOp on the JSClass to update weak raw > pointers as needed. > > Ah, that's great! Thanks, Boris. I ended up using the first suggestion, the way firefox does, and it works nicely with the design pattern.