[Tarantool-patches] [PATCH 2.X 3/7] module api: luaT_newthread

Timur Safin tsafin at tarantool.org
Fri Oct 2 15:27:10 MSK 2020


: From: Vladislav Shpilevoy <v.shpilevoy at tarantool.org>
: Subject: Re: [Tarantool-patches] [PATCH 2.X 3/7] module api:
: luaT_newthread
: 
: Thanks for the patch!
: 
: See 3 comments below.
: 
: On 24.09.2020 19:00, Timur Safin wrote:
: > Exporting `luaT_newthread` as it's necessary for external merger
: >
: > Part of #5273
: > ---
: >  src/exports.h   |  1 +
: >  src/lua/utils.h | 25 +++++++++++++------------
: >  2 files changed, 14 insertions(+), 12 deletions(-)
: >
: > diff --git a/src/exports.h b/src/exports.h
: > index 202f5bf19..20070b240 100644
: > --- a/src/exports.h
: > +++ b/src/exports.h
: > @@ -412,6 +412,7 @@ EXPORT(luaT_checktuple)
: >  EXPORT(luaT_cpcall)
: >  EXPORT(luaT_error)
: >  EXPORT(luaT_istuple)
: > +EXPORT(luaT_newthread)
: >  EXPORT(luaT_pushtuple)
: >  EXPORT(luaT_state)
: >  EXPORT(luaT_tolstring)
: > diff --git a/src/lua/utils.h b/src/lua/utils.h
: > index e9dd27d08..7639cd64a 100644
: > --- a/src/lua/utils.h
: > +++ b/src/lua/utils.h
: > @@ -539,6 +539,19 @@ luaT_tolstring(lua_State *L, int idx, size_t
: *ssize);
: >  LUA_API int
: >  luaL_iscallable(lua_State *L, int idx);
: >
: > +
: 
: 1. Extra empty line.

Yup.
: 
: > +/**
: > + * @brief Creates a new Lua coroutine in a protected frame. If
: > + * <lua_newthread> call underneath succeeds, the created Lua state
: > + * is on the top of the guest stack and a pointer to this state is
: > + * returned. Otherwise LUA_ERRMEM error is handled and the result
: > + * is NULL.
: > + * @param L is a Lua state
: 
: 2.
: 	@param L Lua state.
: 
: Or probably could be even dropped. Such description is useless anyway.

Do you consider that L is obvious for external author 
that it means Lua state? I'd rather disagree.

: 
: > + * @sa <lua_newthread>
: 
: 3. It is worth mentioning that the error is set into the diagnostics
: area.

Indeed, thanks!

Timur



More information about the Tarantool-patches mailing list