[tarantool-patches] Re: [PATCH 1/1] core: make tt_static buffers a singleton array
Konstantin Osipov
kostja at tarantool.org
Sun Apr 28 00:11:53 MSK 2019
* 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.
--
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
More information about the Tarantool-patches
mailing list