artichoke / ferrocarril

🚆 Experiments to embed Ruby on Rails in Rust with mruby
https://artichoke.github.io/ferrocarril/mruby/
MIT License
62 stars 2 forks source link

Remove unnecessary tombstone field from RcBox #203

Closed lopopolo closed 5 years ago

lopopolo commented 5 years ago

RcBox includes a Cell to mark that an Rc is currently being deallocated to prevent double frees. This structure is unnecessary. By reordering a bit in Drop, we can implement the tombstone by setting RcBox.strong to zero on kill. This saves a few bytes per RcBox.