3 ms·
Rust's drop flag is totally unlike Swift's atomic heap reference counting. The drop flag is just an implementation detail that procedures sometimes use to deter
by pcwalton 10y ago
Rust's drop flag is totally unlike Swift's atomic heap reference counting. The drop flag is just an implementation detail that procedures sometimes use to determine whether to run the destructor. It is usually optimized away. It is quite feasible to program without drop flags if you really don't want them, though they never show up in profiles (unlike swift_retain). We could statically eliminate drop flags if we wanted to, via tail duplication. (But we don't, because the drop flags have effectively zero runtime overhead, unlike RC.)