From d866a0d683d88be51e3dec9ce440c548523d03a2 Mon Sep 17 00:00:00 2001 From: Alexander McCord Date: Mon, 3 Jun 2024 20:51:02 -0700 Subject: [PATCH] Let's align the buffer to the nearest alignment point, same as Luau::Variant. --- EqSat/include/Luau/Language.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/EqSat/include/Luau/Language.h b/EqSat/include/Luau/Language.h index 82e1b945..fb02a6d1 100644 --- a/EqSat/include/Luau/Language.h +++ b/EqSat/include/Luau/Language.h @@ -237,8 +237,11 @@ public: template class Language final { + static constexpr size_t bufferSize = std::max({sizeof(Ts)...}); + static constexpr size_t bufferAlign = std::max({alignof(Ts)...}); + const char* tag; - char buffer[std::max({sizeof(Ts)...})]; + alignas(bufferAlign) char buffer[bufferSize]; private: template