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 1A3D628286 for ; Thu, 31 May 2018 11:41:28 -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 vvbFuOAGGIWH for ; Thu, 31 May 2018 11:41:28 -0400 (EDT) Received: from smtp49.i.mail.ru (smtp49.i.mail.ru [94.100.177.109]) (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 CCC4028281 for ; Thu, 31 May 2018 11:41:27 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH v1 2/2] sql: use own region in Parser References: <663c4c7deb9d8eff90407f50da2075990b44f815.1527778868.git.kshcherbatov@tarantool.org> From: Vladislav Shpilevoy Message-ID: Date: Thu, 31 May 2018 18:41:25 +0300 MIME-Version: 1.0 In-Reply-To: <663c4c7deb9d8eff90407f50da2075990b44f815.1527778868.git.kshcherbatov@tarantool.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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: tarantool-patches@freelists.org, Kirill Shcherbatov Thanks for the patch! See 2 comments below. On 31/05/2018 18:01, Kirill Shcherbatov wrote: > diff --git a/src/box/sql/select.c b/src/box/sql/select.c > index 5fbcbaf..b26565b 100644 > --- a/src/box/sql/select.c > +++ b/src/box/sql/select.c > @@ -1762,7 +1762,7 @@ sqlite3ColumnsFromExprList(Parse * parse, ExprList * expr_list, Table *table) > * names for existing table. > */ > assert(table->def->fields == NULL); > - struct region *region = &fiber()->gc; > + struct region *region = &parse->region; > table->def->fields = > region_alloc(region, nCol * sizeof(table->def->fields[0])); > if (table->def->fields == NULL) { > diff --git a/src/box/sql/sqliteInt.h b/src/box/sql/sqliteInt.h > index abf1543..4275f72 100644 > --- a/src/box/sql/sqliteInt.h > +++ b/src/box/sql/sqliteInt.h > @@ -2913,8 +2913,8 @@ struct Parse { > u8 eTriggerOp; /* TK_UPDATE, TK_INSERT or TK_DELETE */ > u8 eOrconf; /* Default ON CONFLICT policy for trigger steps */ > u8 disableTriggers; /* True to disable triggers */ > - /** Region size at the Parser launch. */ > - size_t region_initial_size; > + /* Region to make SQL temp allocations. */ 1. Please, use /** for out of a function body comments. > + struct region region; > > /************************************************************************** > * Fields above must be initialized to zero. The fields that follow, 2. Did you check it works now on the Kirill Yu. patch? (with additional field in space options).