arena.h: fix Arena::IsInInlineBlock() (#9317)

Summary:
When I enable hugepage on my box, unit test fails, this PR fixes this issue:

[  FAILED  ] ArenaTest.ApproximateMemoryUsage (1 ms)

memory/arena_test.cc:127: Failure
Value of: arena.IsInInlineBlock()
  Actual: true
Expected: false
arena.IsInInlineBlock() = 1
memory/arena_test.cc:127: Failure
Value of: arena.IsInInlineBlock()
  Actual: true
Expected: false

Pull Request resolved: https://github.com/facebook/rocksdb/pull/9317

Reviewed By: ajkr

Differential Revision: D36219813

fbshipit-source-id: 08d040d9f37ec4c16987e4150c2db876180d163d
This commit is contained in:
leipeng 2022-05-09 12:21:21 -07:00 committed by Facebook GitHub Bot
parent 7b55b50839
commit 9f7968b2ed

View File

@ -78,7 +78,7 @@ class Arena : public Allocator {
size_t BlockSize() const override { return kBlockSize; }
bool IsInInlineBlock() const {
return blocks_.empty();
return blocks_.empty() && huge_blocks_.empty();
}
private: