This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: malloc: Trim unused arenas on thread exit


On Wednesday 15 November 2017 08:05 PM, Florian Weimer wrote:
>> "Call tcache destructor in arena_thread_freeres
>>
>> Having separate cleanup functions for arena and tcache could result in
>> the tcache freeres function being called later and thus not deallocate
>> data for the thread arena.  Avoid this by calling the tcache cleanup
>> function from within arena_thread_freeres."
> 
> But I have not verified that this actually happens, and we agreed that
> it was a good change nevertheless.

Then maybe this is a more accurate description:

"Call tcache destructor in arena_thread_freeres

It does not make sense to register separate cleanup functions for arena
and tcache since they're always going to be called together.  Call the
tcache cleanup function from within arena_thread_freeres since it at
least makes the order of those cleanups clear in the code."

My point is that we should be documenting the change clearly enough in
the commit log that one shouldn't have to read the code to get a high
level understanding of what the change is about.

Siddhesh


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]