mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-05-19 11:26:26 +03:00
Fix arenas_cache_cleanup().
Fix arenas_cache_cleanup() to handle allocation/deallocation within the application's thread-specific data cleanup functions even after arenas_cache is torn down.
This commit is contained in:
parent
b5c2a347d7
commit
45e9f66c28
3 changed files with 15 additions and 2 deletions
|
|
@ -56,9 +56,14 @@ static void *
|
|||
thd_start(void *arg)
|
||||
{
|
||||
data_t d = (data_t)(uintptr_t)arg;
|
||||
void *p;
|
||||
|
||||
assert_x_eq(*data_tsd_get(), DATA_INIT,
|
||||
"Initial tsd get should return initialization value");
|
||||
|
||||
p = malloc(1);
|
||||
assert_ptr_not_null(p, "Unexpected malloc() failure");
|
||||
|
||||
data_tsd_set(&d);
|
||||
assert_x_eq(*data_tsd_get(), d,
|
||||
"After tsd set, tsd get should return value that was set");
|
||||
|
|
@ -67,6 +72,7 @@ thd_start(void *arg)
|
|||
assert_x_eq(*data_tsd_get(), (data_t)(uintptr_t)arg,
|
||||
"Resetting local data should have no effect on tsd");
|
||||
|
||||
free(p);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue