Skip to content

file_system.wrapper.remove.redudant.fields#10545

Open
rockeet wants to merge 1 commit into
facebook:mainfrom
rockeet:file_system.wrapper.remove.extra.fields
Open

file_system.wrapper.remove.redudant.fields#10545
rockeet wants to merge 1 commit into
facebook:mainfrom
rockeet:file_system.wrapper.remove.extra.fields

Conversation

@rockeet

@rockeet rockeet commented Aug 20, 2022

Copy link
Copy Markdown
Contributor

Remove redundant field.

@mrambacher

Copy link
Copy Markdown
Contributor

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.

@rockeet

rockeet commented Aug 21, 2022

Copy link
Copy Markdown
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants