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 9A9C16EC55; Thu, 9 Sep 2021 13:45:14 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 9A9C16EC55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1631184314; bh=JhXPZ/BTWmGJx8r5YDBSnnd6vxatAoadGzrZQSAteN4=; h=To:References:Date:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=gzJog1eePHAs0RCFZVju2cZhXO/VgCDiTksR1m9ss0gyAlUzPhpABBRpgs9Zo9hUq vVg503Q7D3+uEDIpdJTukryL5OIajYOZG0lHpxc71dRl5yvrzEqKsfIOBbg+evOtWI JTCSVElDZp1Yq+4hd6z3ot5mfh1egFmIqis6xl0g= Received: from smtp61.i.mail.ru (smtp61.i.mail.ru [217.69.128.41]) (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 B3C8C6EC55 for ; Thu, 9 Sep 2021 13:45:12 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org B3C8C6EC55 Received: by smtp61.i.mail.ru with esmtpa (envelope-from ) id 1mOHYN-0007Gr-CW; Thu, 09 Sep 2021 13:45:11 +0300 To: Vladimir Davydov , Oleg Babin via Tarantool-patches References: <20210909102116.j7jlyfdmyngtx4ot@esperanza> Message-ID: <585fda5d-1598-b28a-9f22-61f1f7eb9360@tarantool.org> Date: Thu, 9 Sep 2021 13:45:10 +0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210909102116.j7jlyfdmyngtx4ot@esperanza> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD91AE02D33A9C88A2FBA0FFC16CEFBFC694531AE86BFF036DF00894C459B0CD1B9242A76D5450A897570E831C3866E014AA7C33A8A602EF2D0420FBB3A611A521E X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7C2204D4F9A221771EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637826327602763C04B8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8896A5B728B6E5BC7F61A098681762230117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC974A882099E279BDA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD18F04B652EEC242312D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EED76C6ED7039589DED94E105876FE7799D8FC6C240DEA7642DBF02ECDB25306B2B78CF848AE20165D0A6AB1C7CE11FEE389DDFE3E282F3DD103F1AB874ED89028C4224003CC836476EA7A3FFF5B025636E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F7900637FB177F6A8366F17BEFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-C1DE0DAB: 0D63561A33F958A50A4A17ACD3D5E1A6EC896F7402ED373C1943117C6BED2099D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75E3127721F5A72C97410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34B5900AD87B4159A4F609E21CD6585E5F1558E641FF15B90CF52DF185948383F72A7D3BA8BAEF7A541D7E09C32AA3244CBFE6AC8EF4A1731C1E0C0441CA0CA57FE646F07CC2D4F3D883B48618A63566E0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojV8xpaxME9p9JkVNsJFjtrw== X-Mailru-Sender: 583F1D7ACE8F49BD1042885CEC987B6BC65BFC171BE00B2AC24A38CEAD957A87EFC4EB6826DC22487019711D9D5B048E1458020726E2BC9FD5ECBA0B92C0A936CDC7563AA7CEBD287402F9BA4338D657ED14614B50AE0675 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v4 0/4] fiber: keep reference to userdata if fiber created once 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: Oleg Babin via Tarantool-patches Reply-To: Oleg Babin Cc: tml , v.shpilevoy@tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Thanks for your review. On 09.09.2021 13:21, Vladimir Davydov via Tarantool-patches wrote: > On Wed, Sep 08, 2021 at 09:19:58PM +0300, Oleg Babin via Tarantool-patches wrote: >> [2] https://github.com/tarantool/tarantool/pull/6280 > Reviewed in the PR. Fixed. Diff: diff --git a/src/lib/core/fiber.h b/src/lib/core/fiber.h index 9ac0cbb9f..67e1a55e3 100644 --- a/src/lib/core/fiber.h +++ b/src/lib/core/fiber.h @@ -45,6 +45,14 @@  #include +/* + * This constant is the same as LUA_NOREF. It should be used + * to initialize all Lua references in struct fiber. + * Since this module is independent on Lua the constant is + * defined directly. Value should be checked with + * static_assert in appropriate places to catch possible + * LUA_NOREF value changes in future. + */  #define FIBER_LUA_NOREF (-2)  /* @@ -627,7 +635,7 @@ struct fiber {              struct lua_State *stack;              /**               * Optional reference to userdata -             * represented current fiber id in Lua. +             * representing current fiber id in Lua.               */              int fid_ref;              /** diff --git a/src/lua/fiber.c b/src/lua/fiber.c index 12836da69..95634a4d0 100644 --- a/src/lua/fiber.c +++ b/src/lua/fiber.c @@ -38,6 +38,7 @@  #include  #include +  static_assert(FIBER_LUA_NOREF == LUA_NOREF, "FIBER_LUA_NOREF is ok");  void