Closed laurynas-biveinis closed 3 months ago
@luqun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
@luqun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
This pull request has been merged in facebook/mysql-5.6@f6ecdf715fc8d642a280420e6ba82b102a17f0d0.
std::shared_ptr
should be stored and passed around in situations where the pointed-to object lifetime is unclear, when it has to be extended, or when forced to (i.e. RocksDB API returns it). Some of the uses in MyRocks do not fall under these categories and can be simplified to direct (constant) references.This cleans up some low hanging fruit, focusing on
Rdb_converter
,Rdb_iterator_base
, &Rdb_iterator_partial
classes. Since these classes replace shared pointer fields with reference ones, make them non-copyable and non-moveable for safety, which matches their existing use. At the same time makeRdb_tbl_prop_coll::read_stats_from_tbl_prop
return vector directly instead of using an output parameter.