Fix arena_get() for (!init_if_missing && refresh_if_missing) case.

Fix arena_get() to refresh the cache as needed in the (!init_if_missing
&& refresh_if_missing) case.

This flaw was introduced by the initial arena_get() implementation,
which was part of 8bb3198f72 (Refactor/fix
arenas manipulation.).
This commit is contained in:
Jason Evans 2015-02-09 16:19:27 -08:00
parent 8d0e04d42f
commit 23694b0745

View File

@ -755,10 +755,7 @@ arena_get(tsd_t *tsd, unsigned ind, bool init_if_missing,
arena = arenas_cache[ind]; arena = arenas_cache[ind];
if (likely(arena != NULL) || !refresh_if_missing) if (likely(arena != NULL) || !refresh_if_missing)
return (arena); return (arena);
if (init_if_missing)
return (arena_get_hard(tsd, ind, init_if_missing)); return (arena_get_hard(tsd, ind, init_if_missing));
else
return (NULL);
} }
#endif #endif