From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp20.mail.ru (smtp20.mail.ru [94.100.179.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id F0C4F469710 for ; Fri, 5 Jun 2020 15:11:53 +0300 (MSK) From: "Timur Safin" References: <2914883e-7c71-fd12-0512-5a2e92543efb@tarantool.org> <7c6d16bd-b943-63d6-97e6-b7ef2d9ee8c9@tarantool.org> In-Reply-To: <7c6d16bd-b943-63d6-97e6-b7ef2d9ee8c9@tarantool.org> Date: Fri, 5 Jun 2020 15:11:52 +0300 Message-ID: <02db01d63b32$7f592300$7e0b6900$@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Language: ru Subject: Re: [Tarantool-patches] [PATCH small 1/1] region: new region_alloc_array, updated alloc_object List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: 'Vladislav Shpilevoy' , 'Aleksandr Lyapunov' , tarantool-patches@dev.tarantool.org : From: Vladislav Shpilevoy : Subject: Re: [PATCH small 1/1] region: new region_alloc_array, updated : alloc_object : ... : Worse again it becomes, when size is needed not only in diag, but : also in case of success. For example, to make a memset(0). In this : case it is either triple code duplication, or double code duplication : but with size_t size/bsize variable anyway. : : region_alloc_object() got the out parameter to be consistent with : region_alloc_array(). : : I tried removing the out parameter, and it started looking worse. Agreed, that if extra macro argument `size` would simplify the code then it's a good thing, despite all apparent ugliness. Timur