malloc: Trim unused arenas on thread exit
Florian Weimer
fweimer@redhat.com
Wed Nov 15 14:10:00 GMT 2017
On 11/15/2017 03:00 PM, Siddhesh Poyarekar wrote:
> On Wednesday 15 November 2017 07:06 PM, Florian Weimer wrote:
>> Here's a patch which does just that. Tested with and without
>> --disable-experimental-malloc.
>>
>> It doesn't have any consolidation/trimming changes.
>
> LGTM, I trust you'll write a nice git commit log to explain the change :)
I assumed the comment was sufficient:
>> static void __attribute__ ((section ("__libc_thread_freeres_fn")))
>> arena_thread_freeres (void)
>> {
>> + /* Shut down the thread cache first. This could deallocate data for
>> + the thread arena, so do this before we put the arena on the free
>> + list. */
>> + tcache_thread_shutdown ();
If it is not, we need to put more documentation in the code itself.
Thanks,
Florian
More information about the Libc-alpha
mailing list