From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (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 99BD0469719 for ; Wed, 23 Sep 2020 17:25:09 +0300 (MSK) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) From: Roman Khabibov In-Reply-To: <06ae460c-b078-cbbb-14b5-7970ba669d40@tarantool.org> Date: Wed, 23 Sep 2020 17:25:06 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <3B490721-31EA-4FC9-B38E-48F70BCC8C19@tarantool.org> References: <20200911215115.6622-1-roman.habibov@tarantool.org> <20200911215115.6622-5-roman.habibov@tarantool.org> <06ae460c-b078-cbbb-14b5-7970ba669d40@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH v4 4/6] sql: use parser's region of "index" array List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy Cc: tarantool-patches@dev.tarantool.org Hi Thanks for the review. > On Sep 17, 2020, at 17:53, Vladislav Shpilevoy = wrote: >=20 > Thanks for the patch! >=20 > On 11.09.2020 23:51, Roman Khabibov wrote: >> Allocate memory for the "index" array of ephemeral space on the >> parser's region instead of a heap as it was before. Fixed a memory >> leak that realloc() generated. >=20 > You need to provide more info why it can't be stored on the heap, > and why free() can't be simply called somewhere. Actually, it can be stored on the heap. I thought that getting rid of malloc/free is the main point of using region. The region is also well suited for this task, because space-> index is information that is needed only for parsing and should be destroyed with parsed. I = dropped this patch and added free in the new patch.