diff options
author | Chris Robinson <[email protected]> | 2016-07-04 20:35:32 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2016-07-04 20:35:32 -0700 |
commit | 8f4d6c48ce6621e2e2b79ada781b9e3dfc9ed38c (patch) | |
tree | f0e16e88cfaea9d89f019efa2637324060d0e0e4 /include | |
parent | f0cbcdc928b6a0615199dde56f3b7f0ac31cc6cb (diff) |
Use separate arrays for UIntMap keys and values
Diffstat (limited to 'include')
-rw-r--r-- | include/uintmap.h | 10 |
1 files changed, 5 insertions, 5 deletions
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); |