From 5ee10c336581b68ba91c7048431809e3ccaf7e87 Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Tue, 4 Feb 2025 14:52:18 -0500 Subject: Bug fixes --- include/framework/DynamicExtension.h | 3 ++- include/framework/scheduling/Version.h | 3 +-- tests/include/concurrent_extension.h | 5 +++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/include/framework/DynamicExtension.h b/include/framework/DynamicExtension.h index 91bed98..ef36de3 100644 --- a/include/framework/DynamicExtension.h +++ b/include/framework/DynamicExtension.h @@ -445,6 +445,7 @@ private: /* we first construct a shard from the buffer */ auto buffview = args->version->get_buffer(); assert(buffview.get_tail() != buffview.get_head()); + size_t new_head = buffview.get_tail(); auto new_shard = std::make_shared(std::move(buffview)); @@ -471,7 +472,7 @@ private: args->version->set_structure(std::move(structure)); } - args->version->advance_buffer_head(); + args->version->advance_buffer_head(new_head); } /* perform all of the reconstructions */ diff --git a/include/framework/scheduling/Version.h b/include/framework/scheduling/Version.h index 9c62ea1..3e93202 100644 --- a/include/framework/scheduling/Version.h +++ b/include/framework/scheduling/Version.h @@ -84,8 +84,7 @@ public: return version; } - bool advance_buffer_head() { - auto new_head = m_buffer->get_buffer_view().get_tail(); + bool advance_buffer_head(size_t new_head) { m_buffer_head = new_head; return m_buffer->advance_head(new_head); } diff --git a/tests/include/concurrent_extension.h b/tests/include/concurrent_extension.h index f6d01fd..63ccf87 100644 --- a/tests/include/concurrent_extension.h +++ b/tests/include/concurrent_extension.h @@ -137,6 +137,11 @@ START_TEST(t_insert_with_mem_merges) if (test_de->insert(r)) { r = R{r.key + 1, r.value + 1}; cnt++; + + if (test_de->get_record_count() != cnt + 1000) { + fprintf(stderr, "here!\n"); + + } ck_assert_int_eq(test_de->get_record_count(), cnt + 1000); } else { _mm_pause(); -- cgit v1.2.3