rocksdb icon indicating copy to clipboard operation
rocksdb copied to clipboard

file_system.wrapper.remove.redudant.fields

Open rockeet opened this issue 3 years ago • 2 comments

Remove redundant field.

rockeet avatar Aug 20 '22 13:08 rockeet

I am confused as to the advantage of this change. The existing code uses a unique ptr to store the moved unique ptr. The proposal uses a raw pointer to accomplish the same result.

Is there a reason the raw approach is better than the unique ptr one? I believe there are very few unguarded pointers left in RocksDB intentionally.

mrambacher avatar Aug 21 '22 00:08 mrambacher

I am confused as to the advantage of this change. The existing code uses a unique ptr to store the moved unique ptr. The proposal uses a raw pointer to accomplish the same result.

Is there a reason the raw approach is better than the unique ptr one? I believe there are very few unguarded pointers left in RocksDB intentionally.

The raw ptr target_ is already defined in base class, the unique_ptr is a new data field in derived class which consume memory and is just a copy of target_ in base class.

rockeet avatar Aug 21 '22 02:08 rockeet