[tarantool-patches] Re: [PATCH 1/1] core: make tt_static buffers a singleton array

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Sun Apr 28 19:56:36 MSK 2019



On 28/04/2019 00:11, Konstantin Osipov wrote:
> * Vladislav Shpilevoy <v.shpilevoy at tarantool.org> [19/04/27 15:39]:
>> tt_static_buf() is a function rotating 4 thread local buffers
>> declared inside this function as 'static' variables. They are
>> used very often for a plenty of purposes from string formatting
>> to small MessagePack encoding/decoding.
>>
>> This array of 4 buffers was supposed to be a singleton object,
>> but function tt_static_buf() did not belong to a one certain
>> linking item - it was 'static inline' function in a header
>> 'trivia/util.h'. It means that *each* linking item (each .c file
>> using these buffers) included its own version of this function
>> with its own *copy* of these 4 buffers.
>>
>> Totally there were nearly 50 copies of 4Kb buffer in various
>> files, according to the difference seen in 'vmmap' program on
>> Mac (like /proc/pid/maps on Linux). This patch frees 200Kb of
>> BSS section.
> 
> OK to push. Please push to 2.1 and 1.10 as well.

I will not push this commit into the master, because it is
fixed by the static memory allocator. See the new mail thread.

Talking of 1.10 and 2.1 - I could push if you approve that the
bug will be fixed differently in 1.10/2.1 vs the master. Not
sure if we should push a new allocator into these branches.

> 
> 
> -- 
> Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
> 




More information about the Tarantool-patches mailing list