From c42bd1d6ca463cff9b5bcfeff483d3c5d349cab1 Mon Sep 17 00:00:00 2001 From: Jack Kilgore Date: Tue, 28 Oct 2025 11:12:39 -0700 Subject: [PATCH] fix: relax alignment conditions of BlockEvent to make it compatible with choc_SmallVector --- runtime/elem/BlockEvents.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/elem/BlockEvents.h b/runtime/elem/BlockEvents.h index c2e91317..1ef71651 100644 --- a/runtime/elem/BlockEvents.h +++ b/runtime/elem/BlockEvents.h @@ -32,7 +32,7 @@ struct BlockEvent { size_t time; static constexpr size_t kMaxObjectSize = 64; - alignas(std::max_align_t) std::byte data[kMaxObjectSize]; + alignas(uint64_t) std::byte data[kMaxObjectSize]; std::type_index typeIndex; template @@ -41,7 +41,7 @@ struct BlockEvent { , typeIndex(std::type_index(typeid(T))) { static_assert(sizeof(T) <= kMaxObjectSize, "Type too large for BlockEvent buffer"); - static_assert(alignof(T) <= alignof(std::max_align_t), "Type alignment too strict"); + static_assert(alignof(T) <= alignof(uint64_t), "Type alignment too strict"); static_assert(std::is_trivially_copyable_v, "Type must be trivially copyable"); new(data) T(std::forward(d));