-
Notifications
You must be signed in to change notification settings - Fork 7.2k
[WIP][core] ReferenceProtoTable cleanup #60611
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request provides a nice cleanup by removing the ReferenceProtoTable type alias and its associated conversion function ReferenceTableToProto. The logic is simplified by directly populating the ReferenceTableProto protobuf message. Additionally, the introduction of an encountered set in GetAndClearLocalBorrowersInternal is a great improvement to prevent infinite recursion on cyclic object dependencies. The changes look solid and improve code maintainability. I have one minor suggestion for removing some dead code.
| &borrowed_refs)); | ||
| for (const auto &[id, ref] : borrowed_refs) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was moved inside GetAndClearLocalBorrowersInternal for implementation convenience
| } | ||
|
|
||
| void ReferenceCounter::Reference::ToProto(rpc::ObjectReferenceCount *ref, | ||
| bool deduct_local_ref) const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found it to be a better separation of concerns to avoid any control flow inside the proto serialization method.
No description provided.