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 24C95988E72; Fri, 19 Jan 2024 14:42:04 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 24C95988E72 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1705664524; bh=gAXK3JYqwazrHkT/bdZce9YUSqoUxY8dUuJSadwNlIU=; 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=xOO4d8MX51lWHVGumx64lYp5N83qZzTG+q1G+kl8RjKsyJsPXLC0RYDeQOOjNPsl1 r6fKhHjCdmnfAu7YQVqX3d5NaGOqikKc2MULj4RXCvp3y28/I6qMoyBHzB0atzaJSI 8RLVBJjwTebUDj/yq+c9xAZNc88GKF6pAP3e8a9k= Received: from smtp16.i.mail.ru (smtp16.i.mail.ru [95.163.41.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 3DEE29885EC for ; Fri, 19 Jan 2024 14:37:11 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 3DEE29885EC Received: by smtp16.i.mail.ru with esmtpa (envelope-from ) id 1rQnBO-00FDC7-1r; Fri, 19 Jan 2024 14:37:10 +0300 To: Maxim Kokryashkin , Sergey Bronnikov Date: Fri, 19 Jan 2024 14:32:33 +0300 Message-ID: <816dda065330aa0919ca94cecdc0461eb29a14c6.1705661401.git.skaplun@tarantool.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 78E4E2B564C1792B X-77F55803: 4F1203BC0FB41BD9AE5B4AFB3AE2A5902CFE8E94CF0C73ACB74CDF9E4EA2BA5F182A05F538085040853F1A93E3B43C1277CA480E2D39EF6FB1796298F474B00C9781CE9DFDB48C9B X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE782A779A89F7D69B2C2099A533E45F2D0395957E7521B51C2CFCAF695D4D8E9FCEA1F7E6F0F101C6778DA827A17800CE70760526B31D64A36EA1F7E6F0F101C6723150C8DA25C47586E58E00D9D99D84E1BDDB23E98D2D38B73AB1701401CD871CE6B63048FE26B8394BCAB68BC173F05CC7F00164DA146DAFE8445B8C89999728AA50765F79006375FFD5C25497261569FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C362968DCAA3E4B45B117882F4460429728AD0CFFFB425014E868A13BD56FB6657E2021AF6380DFAD1A18204E546F3947C062BEEFFB5F8EA3E2E808ACE2090B5E1725E5C173C3A84C317B107DEF921CE79089D37D7C0E48F6C8AA50765F790063747074E5DE1517656EFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-C1DE0DAB: 0D63561A33F958A54540431FE22697023DE3FD803DF40A2F704932623D02D7DDF87CCE6106E1FC07E67D4AC08A07B9B0034D30FDF2F620DB9C5DF10A05D560A950611B66E3DA6D700B0A020F03D25A0997E3FB2386030E77 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CFFA600D20059E0BC1211E5C953F59326EFCDB46EEFC0603E5556D05EC89B9670B75F3776783CA996B6197189FEE4B1C7AA5746AC171C0B99088B28D8B641484A5A74DFFEFA5DC0E7F02C26D483E81D6BE5EF9655DD6DEA7D65774BB76CC95456EEC5B5AD62611EEC62B5AFB4261A09AF0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojJsr4kcGAUCNl+1RKID9A1A== X-DA7885C5: AC6127AA04865C2A22358C9D20223E7BC0983B2D7C05146322858ECAE0A6AED9262E2D401490A4A0DB037EFA58388B346E8BC1A9835FDE71 X-Mailru-Sender: 689FA8AB762F7393590D8C940224AE337A6D0D4337E1A496EA419450D64D8A780FBE9A32752B8C9C2AA642CC12EC09F1FB559BB5D741EB962F61BD320559CF1EFD657A8799238ED55FEEDEB644C299C0ED14614B50AE0675 X-Mras: Ok Subject: [Tarantool-patches] [PATCH luajit 10/25] test: enable 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: Sergey Kaplun via Tarantool-patches Reply-To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" This patch declares functions as local to avoid pollution of the global environment. It separates the body of the test in the `do` `while` block and includes the test in . Part of tarantool/tarantool#9398 --- .../lib/ffi/ffi_gcstep_recursive.lua | 27 ++++++++++--------- test/LuaJIT-tests/lib/ffi/index | 1 + 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/test/LuaJIT-tests/lib/ffi/ffi_gcstep_recursive.lua b/test/LuaJIT-tests/lib/ffi/ffi_gcstep_recursive.lua index cb19df11..f6e0b009 100644 --- a/test/LuaJIT-tests/lib/ffi/ffi_gcstep_recursive.lua +++ b/test/LuaJIT-tests/lib/ffi/ffi_gcstep_recursive.lua @@ -1,6 +1,6 @@ -- From Robert G. Jakabosky, 2012-03-20 -local N=tonumber(arg[1] or 10000) +local N= 10000 local ffi=require"ffi" @@ -19,7 +19,7 @@ local function obj_to_id(ptr) return tonumber(ffi.cast('uintptr_t', ffi.cast('void *', ptr))) end -function obj_type_Buffer_push(val) +local function obj_type_Buffer_push(val) local obj = Buffer(val) local id = obj_to_id(obj) nobj_obj_flags[id] = true @@ -31,7 +31,7 @@ local function Buffer_new(len) return obj_type_Buffer_push(buf) end -function obj_type_Buffer_delete(obj) +local function obj_type_Buffer_delete(obj) local id = obj_to_id(obj) if not nobj_obj_flags[id] then return nil end nobj_obj_flags[id] = nil @@ -52,15 +52,16 @@ Buffer_mt.__index.close = Buffer_close ffi.metatype(Buffer, Buffer_mt) -local cdata = {} -for x=1,2 do - cdata = {} - for i=1,N do - cdata[i] = Buffer_new(1) +do --- buffer test + local cdata = {} + for x=1,2 do + cdata = {} + for i=1,N do + cdata[i] = Buffer_new(1) + end + for i=1,N do + cdata[i]:close() + end + cdata = nil end - for i=1,N do - cdata[i]:close() - end - cdata = nil end - diff --git a/test/LuaJIT-tests/lib/ffi/index b/test/LuaJIT-tests/lib/ffi/index index b11e5aa4..8236ab98 100644 --- a/test/LuaJIT-tests/lib/ffi/index +++ b/test/LuaJIT-tests/lib/ffi/index @@ -9,6 +9,7 @@ ffi_callback.lua ffi_const.lua ffi_convert.lua ffi_enum.lua +ffi_gcstep_recursive.lua istype.lua jit_array.lua jit_complex.lua -- 2.43.0