Skip to content
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

Automated Code Change #16922

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions xla/service/service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1151,18 +1151,4 @@ GlobalData::~GlobalData() {
}
}

/* static */ void GlobalData::Release(
std::vector<std::unique_ptr<GlobalData>> instances) {
absl::flat_hash_map<Service*, std::vector<GlobalDataHandle>>
parent_handles_map;
for (auto& instance : instances) {
if (instance->parent_ != nullptr) {
parent_handles_map[instance->parent_].push_back(instance->Release());
}
}
for (auto& parent_handles : parent_handles_map) {
ReleaseHandles(parent_handles.first, parent_handles.second);
}
}

} // namespace xla
11 changes: 0 additions & 11 deletions xla/service/service.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,7 @@ class GlobalData {

const GlobalDataHandle& handle() const { return handle_; }

// Releases a set of GlobalData handles. A single RPC will be issued
// per unique Service of the given GlobalData objects.
static void Release(std::vector<std::unique_ptr<GlobalData>> instances);

private:
// Detaches the global data handle from the object, such that the destructor
// will not try to release it.
GlobalDataHandle Release() {
parent_ = nullptr;
return handle_;
}

GlobalDataHandle handle_; // Handle being wrapped.
Service* parent_; // Service used to unregister handle_.

Expand Down
Loading