From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <imun@tarantool.org>
Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149])
 (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 CBA69469719
 for <tarantool-patches@dev.tarantool.org>;
 Sat,  3 Oct 2020 20:08:26 +0300 (MSK)
Date: Sat, 3 Oct 2020 19:57:51 +0300
From: Igor Munkin <imun@tarantool.org>
Message-ID: <20201003165751.GJ18920@tarantool.org>
References: <cover.1600955781.git.tsafin@tarantool.org>
 <f1c93189f822cb09756fe24ae64149b932abbb3d.1600955781.git.tsafin@tarantool.org>
 <20200929151946.GZ18920@tarantool.org>
 <0acd01d698d6$d1a23460$74e69d20$@tarantool.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <0acd01d698d6$d1a23460$74e69d20$@tarantool.org>
Subject: Re: [Tarantool-patches] [PATCH 2.X 3/7] module api: luaT_newthread
List-Id: Tarantool development patches <tarantool-patches.dev.tarantool.org>
List-Unsubscribe: <https://lists.tarantool.org/mailman/options/tarantool-patches>, 
 <mailto:tarantool-patches-request@dev.tarantool.org?subject=unsubscribe>
List-Archive: <https://lists.tarantool.org/pipermail/tarantool-patches/>
List-Post: <mailto:tarantool-patches@dev.tarantool.org>
List-Help: <mailto:tarantool-patches-request@dev.tarantool.org?subject=help>
List-Subscribe: <https://lists.tarantool.org/mailman/listinfo/tarantool-patches>, 
 <mailto:tarantool-patches-request@dev.tarantool.org?subject=subscribe>
To: Timur Safin <tsafin@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org, v.shpilevoy@tarantool.org, alexander.turenko@tarantool.org

Timur,

On 02.10.20, Timur Safin wrote:
> : From: Igor Munkin <imun@tarantool.org>
> : Subject: Re: [Tarantool-patches] [PATCH 2.X 3/7] module api:
> : luaT_newthread
> : 
> : Timur,
> : 
> : Thanks for the patch, but I guess this one can be implemented using the
> : existing public interfaces (i.e. Lua C standart API + already exported
> : <luaT_call>). It was done to resolve the issue with Tarantool internal
> : crash[1] and I believe if user need to handle OOM error it can do it by
> : himself.
> : 
> : [1]: https://github.com/tarantool/tarantool/issues/4556
> : 
> : --
> : Best regards,
> : IM
> 
> I do not quite get your point here - here we do want to use that newly
> introduced wrapper luaT_newthread in the external module. Do you suggest
> we reimplement it similarly in the external module? We tried and incr_top()
> was the problematic if we live outside of Tarantool core.
> Or do you mean that we do not want to deal with incr_top(L) from outside?

You literally was around to this function, so you can look again: it has
no LuaJIT internals at all. Once more: this helper can be implemented
via public Lua C standard API (provided by lua.h/lauxlib.h) and
<luaT_call> (provided by module.h). Just borrow the implementation from
lua/utils.c, this is about 40loc with verbose comments -- that's all.

> 
> 
> Timur
> 

-- 
Best regards,
IM