From a6942c271f1b27c79e274bdc87aa370b3bb81cc2 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 29 Dec 2023 08:16:26 -0800 Subject: Clean up some potential allocation alignment mismatches --- common/pffft.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'common/pffft.cpp') diff --git a/common/pffft.cpp b/common/pffft.cpp index bbfbaa49..38380261 100644 --- a/common/pffft.cpp +++ b/common/pffft.cpp @@ -1438,7 +1438,7 @@ gsl::owner pffft_new_setup(unsigned int N, pffft_transform_t trans const size_t storelen{std::max(offsetof(PFFFT_Setup, end) + 2_zu*Ncvec*sizeof(v4sf), sizeof(PFFFT_Setup))}; - gsl::owner storage{::new(V4sfAlignVal) std::byte[storelen]{}}; + auto storage = static_cast>(::operator new[](storelen, V4sfAlignVal)); al::span extrastore{&storage[offsetof(PFFFT_Setup, end)], 2_zu*Ncvec*sizeof(v4sf)}; gsl::owner s{::new(storage) PFFFT_Setup{}}; @@ -1489,8 +1489,7 @@ gsl::owner pffft_new_setup(unsigned int N, pffft_transform_t trans void pffft_destroy_setup(gsl::owner s) noexcept { std::destroy_at(s); - auto storage = reinterpret_cast>(s); - ::operator delete[](storage, V4sfAlignVal); + ::operator delete[](gsl::owner{s}, V4sfAlignVal); } #if !defined(PFFFT_SIMD_DISABLE) -- cgit v1.2.3