Skip to content

Conversation

@edoakes
Copy link
Collaborator

@edoakes edoakes commented Jan 30, 2026

No description provided.

Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
@edoakes edoakes added the go add ONLY when ready to merge, run all tests label Jan 30, 2026
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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.

Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Comment on lines -1362 to -1363
&borrowed_refs));
for (const auto &[id, ref] : borrowed_refs) {
Copy link
Collaborator Author

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 {
Copy link
Collaborator Author

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.

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

Labels

go add ONLY when ready to merge, run all tests

1 participant