From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp60.i.mail.ru (smtp60.i.mail.ru [217.69.128.40]) (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 5DEA846970E for ; Tue, 24 Dec 2019 15:06:30 +0300 (MSK) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3594.4.19\)) From: Roman Khabibov In-Reply-To: <20191221205437.GA45@tarantool.org> Date: Tue, 24 Dec 2019 15:06:27 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <1081F1BD-5243-459F-AADF-B0037F6A6F55@tarantool.org> References: <1b936f83be688cbbc8a1625be61a2841809b5633.1574965971.git.roman.habibov@tarantool.org> <77b2090c-4bfd-c42c-e744-3395eef2e8a3@tarantool.org> <721EA98D-2EC6-4C4C-97B0-6BCEBE889EDA@tarantool.org> <20191221205437.GA45@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH v2 2/3] box: make constraint operations transactional List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sergey Ostanevich Cc: tarantool-patches@dev.tarantool.org, Vladislav Shpilevoy Hi! > And I'm still not sure about memory allocation/deallocation is correct = during > constraint id creation/drop.=20 If you mean: =E2=80=9CWhy do you allocate memory for the name string and = copy it, if the same name is already stored in corresponding index_def/ck_def/fk_def structure=E2=80=9D, I=E2=80=99ll answer you the following. At first, I = didn=E2=80=99t use the constraint name copy and did=E2=80=99t allocate memory for it. I simply put pointer = to the original name stored in corresponding index_def/ck_def/fk_def structure. As a = result, I had broken nodes with thrash instead of payload (name) in the constraint = hash table. It was occurred, because this name was free somewhere before. To avoid = such situations, I decided to copy the constraint name.=