From ed724dc3c380df36d8198ad27a63bf392c077ea7 Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Thu, 8 Feb 2024 13:13:33 -0500 Subject: ISAMTree: added comment explaining the compiler fence --- include/shard/ISAMTree.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/shard/ISAMTree.h') diff --git a/include/shard/ISAMTree.h b/include/shard/ISAMTree.h index b52887a..9458b1f 100644 --- a/include/shard/ISAMTree.h +++ b/include/shard/ISAMTree.h @@ -65,6 +65,10 @@ public: sizeof(Wrapped), (byte**) &m_data); + /* + * without this, gcc seems to hoist the building of the array + * _above_ its allocation under -O3, resulting in memfaults. + */ asm volatile ("" ::: "memory"); auto res = sorted_array_from_bufferview(std::move(buffer), m_data, m_bf); -- cgit v1.2.3