Skip to content

Commit

Permalink
No public description
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 608254035
  • Loading branch information
MediaPipe Team authored and copybara-github committed Feb 19, 2024
1 parent a620309 commit 32647d2
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions mediapipe/gpu/reusable_pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,8 @@ inline absl::StatusOr<std::shared_ptr<Item>> ReusablePool<Item>::GetBuffer() {
{
absl::MutexLock lock(&mutex_);
if (available_.empty()) {
// TODO - propagate absl::Status to GetBuffer caller.
auto buffer_from_factory = item_factory_();
if (!buffer_from_factory.ok() || *buffer_from_factory == nullptr) {
return nullptr;
}
buffer = *std::move(buffer_from_factory);
MP_ASSIGN_OR_RETURN(buffer, item_factory_());
RET_CHECK_NE(buffer, nullptr) << "Failed to create buffer";
} else {
buffer = std::move(available_.back());
available_.pop_back();
Expand Down

0 comments on commit 32647d2

Please sign in to comment.