axmol/thirdparty/openal/core/effectslot.cpp

20 lines
476 B
C++
Raw Normal View History

#include "config.h"
#include "effectslot.h"
#include <stddef.h>
#include "almalloc.h"
2021-05-14 10:15:42 +08:00
#include "context.h"
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.
*/
void *ptr{al_calloc(alignof(EffectSlotArray), EffectSlotArray::Sizeof(count*2))};
2022-04-25 12:02:45 +08:00
return al::construct_at(static_cast<EffectSlotArray*>(ptr), count);
}