From 32de7572ea2f97fd87f94cbf0843b6aaa551b560 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 1 Jan 2024 00:37:03 -0800 Subject: Avoid using al_calloc/al_free in the router --- router/router.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/router/router.cpp b/router/router.cpp index 49bb8367..1fdf45ac 100644 --- a/router/router.cpp +++ b/router/router.cpp @@ -361,7 +361,7 @@ void LoadDriverList() PtrIntMap::~PtrIntMap() { std::lock_guard maplock{mLock}; - al_free(mKeys); + free(mKeys); mKeys = nullptr; mValues = nullptr; mSize = 0; @@ -382,8 +382,7 @@ ALenum PtrIntMap::insert(void *key, int value) ALsizei newcap{mCapacity ? (mCapacity<<1) : 4}; if(newcap > mCapacity) newkeys = static_cast( - al_calloc(16, (sizeof(mKeys[0])+sizeof(mValues[0]))*newcap) - ); + calloc(newcap, sizeof(mKeys[0])+sizeof(mValues[0]))); if(!newkeys) return AL_OUT_OF_MEMORY; auto newvalues = reinterpret_cast(&newkeys[newcap]); @@ -393,7 +392,7 @@ ALenum PtrIntMap::insert(void *key, int value) std::copy_n(mKeys, mSize, newkeys); std::copy_n(mValues, mSize, newvalues); } - al_free(mKeys); + free(mKeys); mKeys = newkeys; mValues = newvalues; mCapacity = newcap; -- cgit v1.2.3