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 A56F89E9868; Tue, 6 Feb 2024 16:59:21 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org A56F89E9868 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1707227961; bh=B3QDe1OID3XNGaCpSaHGdmzETfJlJYwkxBWoUy/waEQ=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=Sdp/Vk3evgaURxh7cLJSBjuNo0Pgz9wonWZmd1TMpIXXEYvQ9Nm66S/AD0/0zN/7B 9MJdHrdK0/ToJWQRsUhPb6i8F3AJXp2N1srDVQgsBV0g2jr6RaTwZmbNTt4rbB6cDb FGdURIlhObRt9mdA4k/wqUH2dkGQLAiI8Zy54oIc= Received: from smtp54.i.mail.ru (smtp54.i.mail.ru [95.163.41.89]) (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 045679E9868 for ; Tue, 6 Feb 2024 16:59:19 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 045679E9868 Received: by smtp54.i.mail.ru with esmtpa (envelope-from ) id 1rXLyo-00000008WJM-0ZY1; Tue, 06 Feb 2024 16:59:18 +0300 Date: Tue, 6 Feb 2024 16:55:20 +0300 To: Maxim Kokryashkin Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD94C460F083DF69F51B9726ADA31168F4196B22ED51EBCAFDA182A05F538085040ACA8B48B4D566D68C7A4B249DE6549FDAE044847FA9E4C5616FBF428892A7DDA38DDB31CD4C7878C X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7571C18AED7CB6805EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637993F4D0874F024C68638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D87FD5337A5B8022C096131AACB5DFAAD962EB1C6B4FED3421CC7F00164DA146DAFE8445B8C89999728AA50765F790063783E00425F71A4181389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8EDCF5861DED71B2F389733CBF5DBD5E9B5C8C57E37DE458B9E9CE733340B9D5F3BBE47FD9DD3FB595F5C1EE8F4F765FCF1175FABE1C0F9B6E2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8BB9CEE4F2B4A90F8475ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: 0D63561A33F958A5DA1392CFEE32B6CB5002B1117B3ED6969B699CCA7095B678F09842853758E9E5823CB91A9FED034534781492E4B8EEAD253F27DA5A70FAF3BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CFBBE749ECA92754C4C366F12B380746FF8AFA5EB3782AE76F6A07F812009913F145CF0F9AF1251E13807D692F32DC70328E5CA0F724A5406B258D987F6F87343B5887694D81DB3C445F4332CA8FE04980913E6812662D5F2A5EAB5682573093F7837F15F2B5E4A70B33F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojh/iSjD2txnONT/c28f6RMg== X-DA7885C5: D84F3871E4532A07F255D290C0D534F975A9D44B910097AE25C7DE5D1FA1B4B76CEE0D636CAE980E5B1A4C17EAA7BC4BEF2421ABFA55128DAF83EF9164C44C7E X-Mailru-Sender: 689FA8AB762F7393590D8C940224AE3320036CC9B4E0372B09F4F9379E77147F3BB5C543B51DD57BE49D44BB4BD9522A059A1ED8796F048DB274557F927329BE89D5A3BC2B10C37545BD1C3CC395C826B4A721A3011E896F X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v2 luajit 17/26] test: enable in LuaJIT-tests 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" Hi, Maxim! Thanks for the review! See the iterative patch below. Branch is force-pushed. On 01.02.24, Maxim Kokryashkin wrote: > Hi, Sergey! > Thanks for the patch! > Please consider my comments below. > On Mon, Jan 29, 2024 at 01:45:17PM +0300, Sergey Kaplun wrote: > > +local fails = require("common.fails") > > > > ffi.cdef([[ > > -typedef struct { int a,b,c; } foo1_t; > > -typedef int foo2_t[?]; > > +typedef struct { int a,b,c; } foo1_new_t; > > +typedef int foo2_new_t[?]; > `new` acts as a namespace here, which are conventionally go at the > beginning. Here and below. Renamed, see the iterative patch below. =================================================================== diff --git a/test/LuaJIT-tests/lib/ffi/ffi_new.lua b/test/LuaJIT-tests/lib/ffi/ffi_new.lua index e5b19053..17578995 100644 --- a/test/LuaJIT-tests/lib/ffi/ffi_new.lua +++ b/test/LuaJIT-tests/lib/ffi/ffi_new.lua @@ -4,30 +4,30 @@ local bit = require("bit") local fails = require("common.fails") ffi.cdef([[ -typedef struct { int a,b,c; } foo1_new_t; -typedef int foo2_new_t[?]; +typedef struct { int a,b,c; } new_foo1_t; +typedef int new_foo2_t[?]; void *malloc(size_t size); void free(void *ptr); ]]) -do --- foo1_new_t - assert(ffi.sizeof("foo1_new_t") == 12) - local cd = ffi.new("foo1_new_t") +do --- new_foo1_t + assert(ffi.sizeof("new_foo1_t") == 12) + local cd = ffi.new("new_foo1_t") assert(ffi.sizeof(cd) == 12) - local foo1_new_t = ffi.typeof("foo1_new_t") - assert(ffi.sizeof(foo1_new_t) == 12) - cd = foo1_new_t() + local new_foo1_t = ffi.typeof("new_foo1_t") + assert(ffi.sizeof(new_foo1_t) == 12) + cd = new_foo1_t() assert(ffi.sizeof(cd) == 12) end -do --- foo2_new_t - assert(ffi.sizeof("foo2_new_t", 3) == 12) - local cd = ffi.new("foo2_new_t", 3) +do --- new_foo2_t + assert(ffi.sizeof("new_foo2_t", 3) == 12) + local cd = ffi.new("new_foo2_t", 3) assert(ffi.sizeof(cd) == 12) - local foo2_new_t = ffi.typeof("foo2_new_t") - fails(ffi.sizeof, foo2_new_t) - assert(ffi.sizeof(foo2_new_t, 3) == 12) - cd = foo2_new_t(3) + local new_foo2_t = ffi.typeof("new_foo2_t") + fails(ffi.sizeof, new_foo2_t) + assert(ffi.sizeof(new_foo2_t, 3) == 12) + cd = new_foo2_t(3) assert(ffi.sizeof(cd) == 12) end =================================================================== > > void *malloc(size_t size); > > void free(void *ptr); > > ]]) > > > > > > -do > > +do --- aligned structure GC > > local oc = collectgarbage("count") > > for al=0,15 do > > local align = 2^al -- 1, 2, 4, ..., 32768 > > @@ -54,17 +54,17 @@ do > > end > > end > > local nc = collectgarbage("count") > > - assert(nc < oc + 3000, "GC step missing for ffi.new") > > + assert(nc < oc * 10, "GC step missing for ffi.new") > Are you sure that this is the lower bound of the GC threshold? For big platforms, yes. But more importantly, this is a relative threshold, so it is unreliable from platform memory usage. > > end > > -- Best regards, Sergey Kaplun