On 20/12/2010 8:48 AM, Sebastian Sylvan wrote:

You might even be able to do pointer-tagging to store e.g. a 2-bit ref
count in the lower bits of the pointer (corresponding to 1, 2, 3
references, or "unknown, consult global refcount", i.e. 0). This adds a
bunch of extra instructions per refcount op, but at least doesn't
require global synchronisation for many cases (only twice for objects
with less than 4 local ref counts), you'd probably still want to only do
this for shared objects, though.

Yeah. Many valid, relatively simple optimizations are possible; optimizing rc traffic is an old field with many tricks. But I'd like to defer actually implementing most such tricks until we've got the rest of the language a bit more under control (and implemented), just as a question of time-spending :)

Thankfully none of the rc-trickery is likely to be very semantics-altering -- worst case maybe moving rc ops to scope boundaries or something -- so I'm happy to let the data lead us where and when it does.

-Graydon
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to