From 9f7968b2ed39ed312d35d8c983a18db746168b30 Mon Sep 17 00:00:00 2001 From: leipeng Date: Mon, 9 May 2022 12:21:21 -0700 Subject: [PATCH] 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 --- memory/arena.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memory/arena.h b/memory/arena.h index 07fc43559..1de04c477 100644 --- a/memory/arena.h +++ b/memory/arena.h @@ -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: