From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp51.i.mail.ru (smtp51.i.mail.ru [94.100.177.111]) (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 E388E469711 for ; Mon, 25 May 2020 09:52:17 +0300 (MSK) References: From: Aleksandr Lyapunov Message-ID: <2914883e-7c71-fd12-0512-5a2e92543efb@tarantool.org> Date: Mon, 25 May 2020 09:52:15 +0300 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US 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 , tarantool-patches@dev.tarantool.org, tsafin@tarantool.org Thanks for the patch! See 1 comment below: On 5/21/20 11:32 PM, Vladislav Shpilevoy wrote: > Also the patch adds an out parameter 'size' for both macros. It > simplifies total size calculation, which is needed almost always, > because total size is included into an error message, if the > allocation fails. I don't like the size returning. Even for array allocation it looks annoying. It's too easy to calculate the size, and compilers will omit the second multiplication with the same args. For single allocation it looks ugly. It's not even a calculation.