aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-12-31 09:35:57 -0800
committerChris Robinson <[email protected]>2023-12-31 09:35:57 -0800
commite8f3c5aaf43a478ecc74eaa7b360c912999c9f5d (patch)
tree9b457a390b38ca6352b3c301c1da448776d9c0fe
parentc01824052b95636fecbe2f30d77aba6d542418a0 (diff)
Use the proper allocator for EffectSlotArray
-rw-r--r--core/effectslot.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/effectslot.cpp b/core/effectslot.cpp
index 4d1e14b3..6c80317e 100644
--- a/core/effectslot.cpp
+++ b/core/effectslot.cpp
@@ -14,7 +14,8 @@ EffectSlotArray *EffectSlot::CreatePtrArray(size_t count) noexcept
/* Allocate space for twice as many pointers, so the mixer has scratch
* space to store a sorted list during mixing.
*/
- if(void *ptr{al_calloc(alignof(EffectSlotArray), EffectSlotArray::Sizeof(count*2))})
+ static constexpr auto AlignVal = std::align_val_t{alignof(EffectSlotArray)};
+ if(gsl::owner<void*> ptr{::operator new[](EffectSlotArray::Sizeof(count*2), AlignVal)})
return al::construct_at(static_cast<EffectSlotArray*>(ptr), count);
return nullptr;
}