From 8f4d6c48ce6621e2e2b79ada781b9e3dfc9ed38c Mon Sep 17 00:00:00 2001 From: Chris Robinson <chris.kcat@gmail.com> Date: Mon, 4 Jul 2016 20:35:32 -0700 Subject: Use separate arrays for UIntMap keys and values --- include/uintmap.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/uintmap.h b/include/uintmap.h index e7c3f93d..acb2749a 100644 --- a/include/uintmap.h +++ b/include/uintmap.h @@ -9,16 +9,16 @@ extern "C" { #endif typedef struct UIntMap { - struct { - ALuint key; - ALvoid *value; - } *array; + ALuint *keys; + /* Shares memory with keys. */ + ALvoid **values; + ALsizei size; ALsizei capacity; ALsizei limit; RWLock lock; } UIntMap; -#define UINTMAP_STATIC_INITIALIZE_N(_n) { NULL, 0, 0, (_n), RWLOCK_STATIC_INITIALIZE } +#define UINTMAP_STATIC_INITIALIZE_N(_n) { NULL, NULL, 0, 0, (_n), RWLOCK_STATIC_INITIALIZE } #define UINTMAP_STATIC_INITIALIZE UINTMAP_STATIC_INITIALIZE_N(~0) void InitUIntMap(UIntMap *map, ALsizei limit); -- cgit v1.2.3