diff options
author | Chris Robinson <[email protected]> | 2024-01-01 00:37:03 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2024-01-01 00:37:03 -0800 |
commit | 32de7572ea2f97fd87f94cbf0843b6aaa551b560 (patch) | |
tree | 9f235d475c0b9a018ae0d4b6442c5b8e84b86120 | |
parent | 2cdce8817ebb80bde92727f8ded0789cc8954919 (diff) |
Avoid using al_calloc/al_free in the router
-rw-r--r-- | router/router.cpp | 7 |
1 files 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<std::mutex> 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<void**>( - 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<int*>(&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; |