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 B86BB29741 for ; Sat, 27 Apr 2019 17:11:56 -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 kxPiakaWTPWl for ; Sat, 27 Apr 2019 17:11:56 -0400 (EDT) Received: from smtp58.i.mail.ru (smtp58.i.mail.ru [217.69.128.38]) (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 0A16E296DD for ; Sat, 27 Apr 2019 17:11:55 -0400 (EDT) Date: Sun, 28 Apr 2019 00:11:53 +0300 From: Konstantin Osipov Subject: [tarantool-patches] Re: [PATCH 1/1] core: make tt_static buffers a singleton array Message-ID: <20190427211153.GB5662@atlas> References: <0739fcb1c2659e40eadc2ca9ad03c1d19954626f.1556309762.git.v.shpilevoy@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0739fcb1c2659e40eadc2ca9ad03c1d19954626f.1556309762.git.v.shpilevoy@tarantool.org> 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: Vladislav Shpilevoy Cc: tarantool-patches@freelists.org * 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. -- Konstantin Osipov, Moscow, Russia, +7 903 626 22 32