From c01824052b95636fecbe2f30d77aba6d542418a0 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 31 Dec 2023 09:08:21 -0800 Subject: Ensure HrtfStore alignment is large enough --- core/hrtf.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core') diff --git a/core/hrtf.cpp b/core/hrtf.cpp index d56c364e..80e38709 100644 --- a/core/hrtf.cpp +++ b/core/hrtf.cpp @@ -382,6 +382,10 @@ std::unique_ptr CreateHrtfStore(uint rate, uint8_t irSize, const al::span elevs, const HrirArray *coeffs, const ubyte2 *delays, const char *filename) { + static_assert(alignof(HrtfStore::Field) <= alignof(HrtfStore)); + static_assert(alignof(HrtfStore::Elevation) <= alignof(HrtfStore)); + static_assert(16 <= alignof(HrtfStore)); + const size_t irCount{size_t{elevs.back().azCount} + elevs.back().irOffset}; size_t total{sizeof(HrtfStore)}; total = RoundUp(total, alignof(HrtfStore::Field)); /* Align for field infos */ -- cgit v1.2.3