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 C964B6EC40; Wed, 11 Aug 2021 23:34:04 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C964B6EC40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1628714044; bh=QUaCvvJp7PO42BjZrGf7ecnVX5ExT6iyVjBovdJkdhg=; h=To:Cc:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=Rl6PEwB6yutGIxoMg0XyUu7D6z0WAsNyWmytPcgMxP0mPwLvtBKOAfg8rssswDtWR 7/Y3w13k0i2hBpZKr96nPAKpc3EWEa1WlLacJSazo4AYLjUw7O7Uwvlg9siqZJrUkE gCRy9jfkPjV5wlzPc0Sr/USAw9a/GnjnkRJgy/yM= Received: from smtp30.i.mail.ru (smtp30.i.mail.ru [94.100.177.90]) (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 AB7EF6EC40 for ; Wed, 11 Aug 2021 23:33:33 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org AB7EF6EC40 Received: by smtp30.i.mail.ru with esmtpa (envelope-from ) id 1mDuuq-0007H4-Qt; Wed, 11 Aug 2021 23:33:33 +0300 To: v.shpilevoy@tarantool.org, imun@tarantool.org Cc: tarantool-patches@dev.tarantool.org Date: Wed, 11 Aug 2021 23:33:28 +0300 Message-Id: <163ea2c0eb0172a784e29e5ea61f22e336e969a5.1628713520.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: 4F1203BC0FB41BD92087353F0EC44DD9BCE6B93DE0C6C3914462CDB1732D383C182A05F538085040BE485F64E8BE399347805740BF07F92311F92DF37E2DA4A15F8FCA8D92AF83E9 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE72E4E5201E1C2E308EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637F757A79C3007ACA28638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D84136241214EABB224BAA976997351E03117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC1BE95B8C87527B4BA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352026055571C92BF10F618001F51B5FD3F9D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EECCD848CCB6FE560C86A01F665E7D37C5D8FC6C240DEA7642DBF02ECDB25306B2B78CF848AE20165D0A6AB1C7CE11FEE317119E5299B287EEC0837EA9F3D19764C4224003CC836476EA7A3FFF5B025636E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F7900637E62180BDA7F10F15EFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A213B5FB47DCBC3458F0AFF96BAACF4158235E5A14AD4A4A4625E192CAD1D9E79D94463893BF8742D0943552C08E826999 X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975C6B668463F4F89F86CD9E40DD40F4128E03EA8715DCCCA8299C2B6934AE262D3EE7EAB7254005DCED7532B743992DF240BDC6A1CF3F042BAD6DF99611D93F60EFA183FDCE24978B01699F904B3F4130E343918A1A30D5E7FCCB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34C02783DDD5A45DEF1E424CAE96CBDC9C799932190FC1F4B49C060550A6C8760617021BF82D5C1C121D7E09C32AA3244C95860466F561C446A50C8FC767153A94BBA718C7E6A9E042FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojKW4rnL99YhKVhDwBQ9qG0Q== X-Mailru-Sender: 583F1D7ACE8F49BD1042885CEC987B6B8D49A1454053B4D047805740BF07F9234AF810104A35EE5E7019711D9D5B048E1458020726E2BC9FD5ECBA0B92C0A936CDC7563AA7CEBD287402F9BA4338D657ED14614B50AE0675 X-Mras: Ok Subject: [Tarantool-patches] [PATCH 1/4] fiber: rename ref to fiber_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 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_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