From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id A52786BD0C; Sun, 11 Apr 2021 21:10:53 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org A52786BD0C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1618164653; bh=0dS+4tYmDMZd77uAW9MfKKT3SUVJ0ENizBzdJBZdalo=; h=To:Cc:References:Date:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=Wx4aWaZ9nTGdI/2bpKN+Akz5gAPnSURE/SgUdzsto7qR5kw9Z9ZxfBbATo8OUBZZW XFoVFcwTBtpTn1u+FOlf9oTwlWoCE3IPUIPJEIAXDbHK8H9jMrQ02y6iaCtmMinlaT DX+gZ0YVfLg6+tcvY9stJt8y6ycGww1FjI3MIVZ4= 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 A320D6BD0C for ; Sun, 11 Apr 2021 21:10:52 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org A320D6BD0C Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1lVeXr-0002Rc-Pi; Sun, 11 Apr 2021 21:10:52 +0300 To: imeevma@tarantool.org, tsafin@tarantool.org Cc: tarantool-patches@dev.tarantool.org References: <03a0defcf93a9c1ac1080d13f9178ea5ab33ae59.1617984948.git.imeevma@gmail.com> Message-ID: Date: Sun, 11 Apr 2021 20:10:50 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: <03a0defcf93a9c1ac1080d13f9178ea5ab33ae59.1617984948.git.imeevma@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD92FFCB8E6708E7480B1C8842CE613979772AC4B34408C6525182A05F538085040F0F4680F59D0A2A848163FDAB71A22966A7AB6DE00902136DFCBC7E92A441B63 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7922E451CE6E839B1EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006372D850D7477D401F58638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B2978FCD1AB45DEF466EF1DD4DC6AFB11B2AAFC1FEE5B068F7D2E47CDBA5A96583C09775C1D3CA48CF62968DCAA3E4B45B117882F4460429724CE54428C33FAD30A8DF7F3B2552694AC26CFBAC0749D213D2E47CDBA5A9658378DA827A17800CE746CC513BB44FBA1D9FA2833FD35BB23DF004C906525384302BEBFE083D3B9BA73A03B725D353964B0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E73542F54486E6D6388DC4224003CC83647689D4C264860C145E X-C1DE0DAB: 0D63561A33F958A548785961F027549EFF85CDDE4BD2C5DDC296EBE37678B12AD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34FD9114F69CA58D1E5DFADA57B7425579642258B091BA2DF9B022BA8FDA0DA0C586F582903FCBF2F61D7E09C32AA3244C302B219BB13CB67FE7CA268385DCEB9339C99C45E8D137E9FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojyKKJYJ15DtIoG5Mygn6jwQ== X-Mailru-Sender: 689FA8AB762F73936BC43F508A06382228EC37B9202A2DAF32F07A1C9CA08F5B3841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v5 15/52] sql: rework mem_move() X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Vladislav Shpilevoy via Tarantool-patches Reply-To: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" I appreciate the work you did here! On 09.04.2021 19:37, Mergen Imeev via Tarantool-patches wrote: > This patch reworks mem_move(). This function moves all content of source > MEM to destination MEM. Source mem is set to NULL. > > Part of #5818 > --- > src/box/sql/mem.c | 57 +++++++++---------------------------------- > src/box/sql/mem.h | 8 ++++-- > src/box/sql/vdbe.c | 23 +---------------- > src/box/sql/vdbeapi.c | 2 +- > 4 files changed, 19 insertions(+), 71 deletions(-) > > diff --git a/src/box/sql/mem.c b/src/box/sql/mem.c > index f75661e04..d56fe56c6 100644 > --- a/src/box/sql/mem.c > +++ b/src/box/sql/mem.c > @@ -315,6 +315,17 @@ mem_copy_as_ephemeral(struct Mem *to, const struct Mem *from) > return; > } > > +int It can be 'void'. The function never fails. > +mem_move(struct Mem *to, struct Mem *from) > +{ > + mem_destroy(to); > + memcpy(to, from, sizeof(*to)); > + from->flags = MEM_Null; > + from->szMalloc = 0; > + from->zMalloc = NULL; > + return 0; > +}