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 380389DC619; Mon, 29 Jan 2024 13:54:56 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 380389DC619 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1706525696; 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=Zxaojh6VuNjyvcgWNCKNqDrG4NeuAN2h1sktR0lmsJ3UycxjDyPHAkEUl0IcVh8du XBwQi4wKthtbriYKi+vTP14RUnUNE0q12PHCaqZhgqLJIlmloCJ7MbiuIj0l/IuxfQ fIDoD0/Nc+kh3TGVmdZ7I4gTmIz52izYMtqSDQc4= Received: from smtp32.i.mail.ru (smtp32.i.mail.ru [95.163.41.73]) (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 55AAE9C2037 for ; Mon, 29 Jan 2024 13:49:35 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 55AAE9C2037 Received: by smtp32.i.mail.ru with esmtpa (envelope-from ) id 1rUPCo-0000000BQ6r-2IGm; Mon, 29 Jan 2024 13:49:34 +0300 To: Maxim Kokryashkin , Sergey Bronnikov Date: Mon, 29 Jan 2024 13:45:11 +0300 Message-ID: <6279ec45b1a87b07f14827da242e82aed866e250.1706520765.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: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD96A58C36AA2E99649B648FE8031739DEAF39E53813A442EB0182A05F5380850406489CD904B29FD8C33594132A326AF8B614CD15EA26CCC5CDCA4176470581478A9012D9B09AE9B97 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7B9FBA884A7C9B8BAEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006372DF490C9F37876FD8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D802601D59DE844784BE1BF1E404F07B8EA9B51E9B4879B9A2CC7F00164DA146DAFE8445B8C89999728AA50765F79006370BDB19F53EE528DD389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8ED96AA85C75E140D117882F4460429728AD0CFFFB425014E868A13BD56FB6657D81D268191BDAD3DC09775C1D3CA48CF7550B81DD467D0A9BA3038C0950A5D36C8A9BA7A39EFB766D91E3A1F190DE8FDBA3038C0950A5D36D5E8D9A59859A8B633F7094D8022965776E601842F6C81A1F004C906525384303E02D724532EE2C3F43C7A68FF6260569E8FC8737B5C2249957A4DEDD2346B42E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B6ACE00135B021D8CA089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A59BBB921C4D25DD9E5002B1117B3ED696CFA578FB70FBCFF533EE06AFCD964888823CB91A9FED034534781492E4B8EEAD329DC2EF12373DEAC79554A2A72441328621D336A7BC284946AD531847A6065A535571D14F44ED41 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF14B88CC82B8982B1F0242B875DF0BA007EB65040B77E72D74BA394BD6E29B9459F3638D7DAB8774B8FB01E7B8BF01A69D81776C03C993E91B718120DE96C5CC5004E6D4C140C8C82C226CC413062362A913E6812662D5F2A5EAB5682573093F7837F15F2B5E4A70B33F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojmd9AG1X07oR+fMugCsRTbg== X-Mailru-Sender: 11C2EC085EDE56FAC07928AF2646A769944272784E62840A33594132A326AF8B614CD15EA26CCC5CB7CBEF92542CD7C88B0A2698F12F5C9EC77752E0C033A69E86920BD37369036789A8C6A0E60D2BB63A5DB60FBEB33A8A0DA7A0AF5A3A8387 X-Mras: Ok Subject: [Tarantool-patches] [PATCH v2 luajit 11/26] 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