On 7/12/13 1:40 PM, Jack Moffitt wrote:
I can write an example of a script that would produce such a situation, if
desired.

Yes, please. I would love to have a concrete example.

So I think there are basically three options:

1. Use the JS GC for everything; eat the cost of eagerly creating all wrappers. As Boris mentioned, maybe this isn't so bad. I would assume this is what Oilpan is doing in Blink.

2. Use the JS GC for wrapped objects and reference counting for non-wrapped objects. This assumes there are no cycles between them, which I believe to be the case (though could be wrong), because strong references from Rust to DOM nodes should be fairly minimal and acyclic (the reference to the root, events, maybe others?)

3. Use the JS GC for wrapped objects and unique ownership coupled with weak pointers for non-wrapped objects. In other words, there is a single "strong owner" for each node and all other pointers from Rust to the DOM are weak. (For example, event targets for queued events would be weak and if the DOM node dies then the event is dropped.) It is not clear to me that this is feasible; however, it might be.

Perhaps at this point we should go with (1) and measure what the cost of the wrappers is, as Boris suggested.

Patrick

_______________________________________________
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo

Reply via email to