From 81e7222633fefd29890e8f1e18af86c4985604f4 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 11 Jan 2019 07:28:44 -0800 Subject: Use a flexible array for the active effect slots --- Alc/alc.cpp | 10 +++------- Alc/alcontext.h | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'Alc') diff --git a/Alc/alc.cpp b/Alc/alc.cpp index ca13e911..cea1fb61 100644 --- a/Alc/alc.cpp +++ b/Alc/alc.cpp @@ -2325,15 +2325,11 @@ static ALvoid InitContext(ALCcontext *Context) //Validate Context if(!Context->DefaultSlot) - auxslots = new ALeffectslotArray{}; + auxslots = ALeffectslot::CreatePtrArray(0); else { - /* Allocate twice as much space for effect slots so the mixer has a - * place to sort them. - */ - auxslots = new ALeffectslotArray{}; - auxslots->reserve(2); - auxslots->push_back(Context->DefaultSlot.get()); + auxslots = ALeffectslot::CreatePtrArray(1); + (*auxslots)[0] = Context->DefaultSlot.get(); } Context->ActiveAuxSlots.store(auxslots, std::memory_order_relaxed); diff --git a/Alc/alcontext.h b/Alc/alcontext.h index dc9ada55..472d06ae 100644 --- a/Alc/alcontext.h +++ b/Alc/alcontext.h @@ -107,7 +107,7 @@ struct ALCcontext { std::atomic VoiceCount{0}; ALsizei MaxVoices{0}; - using ALeffectslotArray = al::vector; + using ALeffectslotArray = al::FlexArray; std::atomic ActiveAuxSlots{nullptr}; std::thread EventThread; -- cgit v1.2.3