Skip to content

Commit

Permalink
fix: add comment about EnsureMemoryBudget
Browse files Browse the repository at this point in the history
  • Loading branch information
dranikpg committed Nov 28, 2023
1 parent e35dbac commit 2cdb8a9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/facade/dragonfly_connection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1358,7 +1358,10 @@ Connection* Connection::WeakRef::Get() const {
}

bool Connection::WeakRef::EnsureMemoryBudget() const {
// Simple optimization: If a connection was closed, don't check memory budget.
if (!ptr_.expired()) {
// We don't rely on the connection ptr staying valid because we only access
// the threads backpressure
backpressure_->EnsureBelowLimit();
return true;
}
Expand Down

0 comments on commit 2cdb8a9

Please sign in to comment.