From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 2D6E62B718 for ; Sun, 28 Apr 2019 12:56:39 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6qs7yXyVf8rB for ; Sun, 28 Apr 2019 12:56:39 -0400 (EDT) Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id DE3DA2B6FE for ; Sun, 28 Apr 2019 12:56:38 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH 1/1] core: make tt_static buffers a singleton array References: <0739fcb1c2659e40eadc2ca9ad03c1d19954626f.1556309762.git.v.shpilevoy@tarantool.org> <20190427211153.GB5662@atlas> From: Vladislav Shpilevoy Message-ID: <554d070c-1a24-92a0-11e4-d20328692c5c@tarantool.org> Date: Sun, 28 Apr 2019 19:56:36 +0300 MIME-Version: 1.0 In-Reply-To: <20190427211153.GB5662@atlas> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: Konstantin Osipov Cc: tarantool-patches@freelists.org On 28/04/2019 00:11, Konstantin Osipov wrote: > * Vladislav Shpilevoy [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 >