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 2F7FA2DD40 for ; Sat, 27 Apr 2019 17:18:06 -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 SgzYX431Mcqp for ; Sat, 27 Apr 2019 17:18:06 -0400 (EDT) Received: from smtp41.i.mail.ru (smtp41.i.mail.ru [94.100.177.101]) (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 E10B4296DD for ; Sat, 27 Apr 2019 17:18:05 -0400 (EDT) Date: Sun, 28 Apr 2019 00:18:03 +0300 From: Konstantin Osipov Subject: [tarantool-patches] Re: [PATCH 1/1] core: introduce tt_static_sized_buf() Message-ID: <20190427211803.GC5662@atlas> References: <687f8dc3342a3e9b6d8138837646837d60e63ed8.1556315009.git.v.shpilevoy@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <687f8dc3342a3e9b6d8138837646837d60e63ed8.1556315009.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]: To solve your particular problem, you could simply increase the static buffer size. This is a one-line patch. I suggest you do it in scope of swim and be done with it. Here is why: Essentially, you introduce a new allocator. A very useful one, indeed, but the protocol should follow one of an allocator, e.g. provide alloc, realloc, and a (no-op) free. The allocator itself should be moved to small/. You should check boundary conditions - e.g. attempt to allocate more memory than the maximal size of the static array - and return 0. tt_static_buf() then can be replaced with static_alloc(desired size). If you wish to do all of the above in a separate patch - you're more than welcome. -- Konstantin Osipov, Moscow, Russia, +7 903 626 22 32