diff options
author | Projjal Chanda <projjal.chanda@mongodb.com> | 2023-01-31 16:59:09 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-01-31 19:39:08 +0000 |
commit | 9afc315f73723d07c434fa738bdde25717bf7708 (patch) | |
tree | cd1b741fbe887117d101688aa5f815d21ece5bc9 /src/mongo/db/pipeline/memory_usage_tracker.h | |
parent | 7026efbe1c99aec1afc56629cc69f683a5599ab8 (diff) | |
download | mongo-9afc315f73723d07c434fa738bdde25717bf7708.tar.gz |
SERVER-69822: Use MemoryUsageTracker::withinMemoryLimit() consistently
Diffstat (limited to 'src/mongo/db/pipeline/memory_usage_tracker.h')
-rw-r--r-- | src/mongo/db/pipeline/memory_usage_tracker.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mongo/db/pipeline/memory_usage_tracker.h b/src/mongo/db/pipeline/memory_usage_tracker.h index b91f0eb57ac..0984b320543 100644 --- a/src/mongo/db/pipeline/memory_usage_tracker.h +++ b/src/mongo/db/pipeline/memory_usage_tracker.h @@ -70,6 +70,10 @@ public: return _maxMemoryBytes; } + bool withinMemoryLimit() const { + return _currentMemoryBytes <= static_cast<long long>(base->_maxAllowedMemoryUsageBytes); + } + MemoryUsageTracker* base = nullptr; private: |