diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2023-03-11 14:51:34 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2023-03-13 12:50:29 +0000 |
commit | 8ad3f6f9fc210ced8915275f795c660fe87ef4a4 (patch) | |
tree | 4cbe2e9df5bf9eef21dba06b082fcce1486285b3 /vespalib/src/tests/btree/btree_test.cpp | |
parent | e73005677cdbc12d1cb613e3020b4fa0dbaef268 (diff) |
Allocate BufferState in stash and add pointer to BufferAndMeta
Diffstat (limited to 'vespalib/src/tests/btree/btree_test.cpp')
-rw-r--r-- | vespalib/src/tests/btree/btree_test.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/vespalib/src/tests/btree/btree_test.cpp b/vespalib/src/tests/btree/btree_test.cpp index ef64549e16a..b8da9ea6042 100644 --- a/vespalib/src/tests/btree/btree_test.cpp +++ b/vespalib/src/tests/btree/btree_test.cpp @@ -1064,7 +1064,8 @@ adjustAllocatedBytes(size_t nodeCount, size_t nodeSize) TEST_F(BTreeTest, require_that_memory_usage_is_calculated) { - constexpr size_t BASE = 163912; + constexpr size_t BASE_ALLOCATED = 28744u; + constexpr size_t BASE_USED = 24984; typedef BTreeNodeAllocator<int32_t, int8_t, btree::NoAggregated, MyTraits::INTERNAL_SLOTS, MyTraits::LEAF_SLOTS> NodeAllocator; @@ -1083,8 +1084,8 @@ TEST_F(BTreeTest, require_that_memory_usage_is_calculated) const uint32_t initialLeafNodes = 128u; mu.incAllocatedBytes(adjustAllocatedBytes(initialInternalNodes, sizeof(INode))); mu.incAllocatedBytes(adjustAllocatedBytes(initialLeafNodes, sizeof(LNode))); - mu.incAllocatedBytes(BASE); - mu.incUsedBytes(BASE); + mu.incAllocatedBytes(BASE_ALLOCATED); + mu.incUsedBytes(BASE_USED); mu.incUsedBytes(sizeof(INode)); mu.incDeadBytes(sizeof(INode)); EXPECT_TRUE(assertMemoryUsage(mu, tm.getMemoryUsage())); @@ -1115,8 +1116,8 @@ TEST_F(BTreeTest, require_that_memory_usage_is_calculated) mu = vespalib::MemoryUsage(); mu.incAllocatedBytes(adjustAllocatedBytes(initialInternalNodes, sizeof(INode))); mu.incAllocatedBytes(adjustAllocatedBytes(initialLeafNodes, sizeof(LNode))); - mu.incAllocatedBytes(BASE); - mu.incUsedBytes(BASE); + mu.incAllocatedBytes(BASE_ALLOCATED); + mu.incUsedBytes(BASE_USED); mu.incUsedBytes(sizeof(INode) * 2); mu.incDeadBytes(sizeof(INode) * 2); mu.incUsedBytes(sizeof(LNode)); |