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 66C9BA6A7DB; Thu, 1 Feb 2024 19:10:43 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 66C9BA6A7DB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1706803843; bh=vZudQmNASX8rzvDwqv3ZoUgswA9DI/GKOGYWswgSgl0=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=Zk4PCMQfrbHNNHT8y1ocTp0yC3hwSTMNqp8vqoivychIbfdLYT5nchp25T//p222H 4v7X1X1m9yh3EMZNJDRlAKL/405YocCkA1TmiNSl4yHm3OwvKU5DzL/LbKZ7IvbqTy CBHXAFYrPzgjxvXKr78z9mjPPzhtgzsmGeGaG25s= Received: from smtp41.i.mail.ru (smtp41.i.mail.ru [95.163.41.64]) (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 43EADA6A7C1 for ; Thu, 1 Feb 2024 19:10:42 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 43EADA6A7C1 Received: by smtp41.i.mail.ru with esmtpa (envelope-from ) id 1rVZeD-00000008Ufj-2iE7; Thu, 01 Feb 2024 19:10:41 +0300 Message-ID: <5ce6b3c8-4ee9-4b9c-a532-04ce78dc528a@tarantool.org> Date: Thu, 1 Feb 2024 19:10:41 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Sergey Kaplun , Maxim Kokryashkin Cc: tarantool-patches@dev.tarantool.org References: <6279ec45b1a87b07f14827da242e82aed866e250.1706520765.git.skaplun@tarantool.org> In-Reply-To: <6279ec45b1a87b07f14827da242e82aed866e250.1706520765.git.skaplun@tarantool.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9010253A383FA2A7573E7F3991072333CCD6CE703AF9322E2182A05F5380850405F10253F4EA8411EC7A4B249DE6549FD31B3C75715F0E91ABBCBD0CDED06F35277626B0F71EFE3B5 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7D9C4478D0B876341EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006379D15B32FCF98DF428638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8640E3A195EC8DFBEE88A1A33F32462FADD247CE3CC9510BFCC7F00164DA146DAFE8445B8C89999728AA50765F7900637CAEE156C82D3D7D9389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8062BEEFFB5F8EA3EF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA73AA81AA40904B5D9A18204E546F3947C5DA91C8160F4BAA0BA3038C0950A5D36C8A9BA7A39EFB766D91E3A1F190DE8FDBA3038C0950A5D36D5E8D9A59859A8B6F657401E1635F1D73AA81AA40904B5D99C9F4D5AE37F343AD1F44FA8B9022EA23BBE47FD9DD3FB595F5C1EE8F4F765FC8C7ADC89C2F0B2A5E2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8BBFD80D3C1F6BEDE875ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: 0D63561A33F958A50BA9CADEEF0CCB865002B1117B3ED69657164A5AC237B049C66B2B37046EC955823CB91A9FED034534781492E4B8EEAD3B72D73EA5828B68BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CFE058A2F74D88C29E052E5406E15BA679A5B0013BF3DB51CD0D88AF9E10128F8C182FB9261F6240E8BAF4CF3B87E910B1D98003C24C3586212BF8F3ECED339AEEC8E009A1DDDA8F885F4332CA8FE04980913E6812662D5F2AB9AF64DB4688768036DF5FE9C0001AF333F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojKdLLj0Q7SP/0/QaNyM1pLQ== X-Mailru-Sender: C4F68CFF4024C8867DFDF7C7F25884588AE68132C8C1F6F0F33F69C7E48EA1FB73A87B05AD22EC0A8D52D8A803B3004D645D15D82EE4B272BD6E4642A116CA93524AA66B5ACBE6721EF430B9A63E2A504198E0F3ECE9B5443453F38A29522196 X-Mras: Ok Subject: Re: [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 Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Sergey thanks for the patch! LGTM On 1/29/24 13:45, Sergey Kaplun wrote: > 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