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 952496EC55; Wed, 8 Sep 2021 21:20:35 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 952496EC55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1631125235; bh=jV8OhBI0HyHb4NgkgkLw1CJe/DnxUBSevxl3GTTZ9b4=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=u16BRsZGFnEVVIHZnxDynvW6+GxG3yHdmiSi+ZIR1IU26emSyB2r19nkHRIw5E4Lm YBvsoPCGDKneIXZYk8yWpi8voNxwdN/Pl1BMSFwzWF2fQP4SEMPNDSdbXZiqdJkQvw oSc9ZPbAwrE7VNhIDNT/ODxza6KtGIbWK+Y6Eelo= Received: from smtp37.i.mail.ru (smtp37.i.mail.ru [94.100.177.97]) (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 527CD6EC55 for ; Wed, 8 Sep 2021 21:20:05 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 527CD6EC55 Received: by smtp37.i.mail.ru with esmtpa (envelope-from ) id 1mO2B2-0003tR-1A; Wed, 08 Sep 2021 21:20:04 +0300 To: v.shpilevoy@tarantool.org, imun@tarantool.org Date: Wed, 8 Sep 2021 21:19:59 +0300 Message-Id: <82b2ccbda86b66a261ce539b1ccbf8e914a150ee.1631124536.git.babinoleg@mail.ru> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD91AE02D33A9C88A2FAC52BB37A480E789638BB4D06A25224200894C459B0CD1B99BF13199369F18FE16E02D3739A858E794E6721A1D1978B77454BA882483358B X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE72E4E5201E1C2E308EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637FD60A286D0BA57028638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D87E9BDDBA409F051181B16B43A919989B117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC1BE95B8C87527B4BA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F4460429728776938767073520B1593CA6EC85F86DE5D25F19253116ADD2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EEB28585415E75ADA9E21AE983DBD7FFC1D8FC6C240DEA7642DBF02ECDB25306B2B78CF848AE20165D0A6AB1C7CE11FEE35FF72824B19451C66136E347CC761E07C4224003CC836476EA7A3FFF5B025636E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F79006376A91CFDE938F542CEFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A213B5FB47DCBC3458F0AFF96BAACF4158235E5A14AD4A4A4625E192CAD1D9E79D2AE6C3BEB5DE9A26378307618878A98D X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975CBF3286B3348795C6309EF7DC5E1DB03349833AD5AC1FBB609C2B6934AE262D3EE7EAB7254005DCED7532B743992DF240BDC6A1CF3F042BAD6DF99611D93F60EFCCE3E035A672CDEE699F904B3F4130E343918A1A30D5E7FCCB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34987A0E8D235BB534B2DC743D962D95F5683E56ABED2E19B5F5084A79C9C458191AD482AA9EF1DB781D7E09C32AA3244CDC72AE124043B55C4DDEB92575ED3ED9A90944CA99CF22E3927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojV8xpaxME9p9RJyfU5UcIsQ== X-Mailru-Sender: 583F1D7ACE8F49BD1042885CEC987B6BD65B487B20582DBD46AB3C82A3FB6FE17962F9E9328436E17019711D9D5B048E1458020726E2BC9FD5ECBA0B92C0A936CDC7563AA7CEBD287402F9BA4338D657ED14614B50AE0675 X-Mras: Ok Subject: [Tarantool-patches] [PATCH v4 1/4] fiber: rename ref to storage_ref 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: olegrok@tarantool.org Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" From: Oleg Babin Ref is a lua reference to fiber storage. This patch just renames storage.lua.ref to storage.lua.storage_ref to underline that it's not a reference to fiber itself and needed only for fiber storage. --- src/lib/core/fiber.h | 2 +- src/lua/fiber.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/core/fiber.h b/src/lib/core/fiber.h index b85625ba7..593847df7 100644 --- a/src/lib/core/fiber.h +++ b/src/lib/core/fiber.h @@ -626,7 +626,7 @@ struct fiber { /** * Optional fiber.storage Lua reference. */ - int ref; + int storage_ref; } lua; /** * Iproto sync. diff --git a/src/lua/fiber.c b/src/lua/fiber.c index 38394666b..83dcbe2fa 100644 --- a/src/lua/fiber.c +++ b/src/lua/fiber.c @@ -670,7 +670,7 @@ lbox_fiber_name(struct lua_State *L) /** * Trigger invoked when the fiber has stopped execution of its - * current request. Only purpose - delete storage.lua.ref keeping + * current request. Only purpose - delete storage.lua.storage_ref keeping * a reference of Lua fiber.storage object. Unlike Lua stack, * Lua fiber storage may be created not only for fibers born from * Lua land. For example, an IProto request may execute a Lua @@ -681,10 +681,10 @@ static int lbox_fiber_on_stop(struct trigger *trigger, void *event) { struct fiber *f = (struct fiber *) event; - int storage_ref = f->storage.lua.ref; + int storage_ref = f->storage.lua.storage_ref; assert(storage_ref > 0); luaL_unref(tarantool_L, LUA_REGISTRYINDEX, storage_ref); - f->storage.lua.ref = LUA_NOREF; + f->storage.lua.storage_ref = LUA_NOREF; trigger_clear(trigger); free(trigger); return 0; @@ -694,7 +694,7 @@ static int lbox_fiber_storage(struct lua_State *L) { struct fiber *f = lbox_checkfiber(L, 1); - int storage_ref = f->storage.lua.ref; + int storage_ref = f->storage.lua.storage_ref; if (storage_ref <= 0) { struct trigger *t = (struct trigger *) malloc(sizeof(*t)); @@ -706,7 +706,7 @@ lbox_fiber_storage(struct lua_State *L) trigger_add(&f->on_stop, t); lua_newtable(L); /* create local storage on demand */ storage_ref = luaL_ref(L, LUA_REGISTRYINDEX); - f->storage.lua.ref = storage_ref; + f->storage.lua.storage_ref = storage_ref; } lua_rawgeti(L, LUA_REGISTRYINDEX, storage_ref); return 1; -- 2.32.0