diff options
Diffstat (limited to 'common/uintmap.c')
-rw-r--r-- | common/uintmap.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/common/uintmap.c b/common/uintmap.c index 21a921b2..98ed3191 100644 --- a/common/uintmap.c +++ b/common/uintmap.c @@ -36,6 +36,11 @@ void ResetUIntMap(UIntMap *map) WriteUnlock(&map->lock); } +void RelimitUIntMapNoLock(UIntMap *map, ALsizei limit) +{ + map->limit = limit; +} + ALenum InsertUIntMapEntry(UIntMap *map, ALuint key, ALvoid *value) { ALsizei pos = 0; @@ -59,7 +64,7 @@ ALenum InsertUIntMapEntry(UIntMap *map, ALuint key, ALvoid *value) if(pos == map->size || map->keys[pos] != key) { - if(map->size == map->limit) + if(map->size >= map->limit) { WriteUnlock(&map->lock); return AL_OUT_OF_MEMORY; @@ -141,7 +146,7 @@ ALenum InsertUIntMapEntryNoLock(UIntMap *map, ALuint key, ALvoid *value) if(pos == map->size || map->keys[pos] != key) { - if(map->size == map->limit) + if(map->size >= map->limit) return AL_OUT_OF_MEMORY; if(map->size == map->capacity) |