mirror of git://sourceware.org/git/glibc.git
malloc: Initiate tcache shutdown even without allocations [BZ #28028]
After commit 1e26d35193 ("malloc: Fix
tcache leak after thread destruction [BZ #22111]"),
tcache_shutting_down is still not early enough. When we detach a
thread with no tcache allocated, tcache_shutting_down would still be
false.
Reviewed-by: DJ Delorie <dj@redhat.com>
This commit is contained in:
parent
784fff6ea5
commit
dfec225ee1
|
|
@ -3144,12 +3144,13 @@ tcache_thread_shutdown (void)
|
||||||
int i;
|
int i;
|
||||||
tcache_perthread_struct *tcache_tmp = tcache;
|
tcache_perthread_struct *tcache_tmp = tcache;
|
||||||
|
|
||||||
|
tcache_shutting_down = true;
|
||||||
|
|
||||||
if (!tcache)
|
if (!tcache)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Disable the tcache and prevent it from being reinitialized. */
|
/* Disable the tcache and prevent it from being reinitialized. */
|
||||||
tcache = NULL;
|
tcache = NULL;
|
||||||
tcache_shutting_down = true;
|
|
||||||
|
|
||||||
/* Free all of the entries and the tcache itself back to the arena
|
/* Free all of the entries and the tcache itself back to the arena
|
||||||
heap for coalescing. */
|
heap for coalescing. */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue