From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 7BFD8469719 for ; Tue, 6 Oct 2020 15:55:32 +0300 (MSK) Received: by mail-lf1-f49.google.com with SMTP id b22so14874027lfs.13 for ; Tue, 06 Oct 2020 05:55:32 -0700 (PDT) Date: Tue, 6 Oct 2020 15:55:29 +0300 From: Cyrill Gorcunov Message-ID: <20201006125529.GH2069@grain> References: <20201001135113.329664-1-gorcunov@gmail.com> <20201001135113.329664-6-gorcunov@gmail.com> <20201005103148.GD2069@grain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Tarantool-patches] [PATCH v4 5/6] box/func: implement cfunc Lua module List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy Cc: tml , Alexander Turenko On Mon, Oct 05, 2020 at 11:59:05PM +0200, Vladislav Shpilevoy wrote: ... > > I just stated a fact - whatever you post after "TarantoolBot document" goes to > a github issue as is, unedited. Therefore it will be interpreted as github > markdown, unconditionally. So you need to write things to make them readable > in github. If you use sphinx markdown, it won't be displayed as sphinx markdown > anyway. It will be displayed in github markdown. > > Talking of the idea about writing docs for copy-pasting, I don't think it can be > done with the current flow of documentation updates. Doc team anyway needs to > find a place to put your text into, translate it to Russian, review and correct > your markdown. Also if we need to write in sphinx style, it means we need to > patch docbot to somehow turn github markdown off, and make other team members > learn this markdown - how to write it and validate. With all that said - why > do we even need a whole documentation team, if this is basically all they do? > > I would better let us write more free-style documentation requests, and let the > doc team do their job. OK > >> > >> 12. You allocated 'sizeof(*cfunc) + name_len + 1)', not only sizeof. > > > > I know, the name of the function is placed right after the structure. > > It is intended. > > How is it related? diag_set in the second argument takes allocation > size. You tried to allocate sizeof(*cfunc) + name_len + 1, but > reported sizeof(*cfunc), which is smaller. It does not depend on what > you allocate. Only how much. Wait, I got it -- you meant the diag_set report. Sorry misundertood you in first place. Thanks, will fix. > >>> + struct cfunc *cfunc = cfunc_lookup(name, name_len); > >>> + if (cfunc == NULL) { > >>> + const char *fmt = tnt_errcode_desc(ER_NO_SUCH_FUNCTION); > >>> + diag_set(IllegalParams, fmt, name); > >>> + return luaT_error(L); > >>> + } > >>> + > >>> + lua_State *args_L = luaT_newthread(tarantool_L); > >> > >> 18. Wtf? Why can't you use L? Why do you even move anything here > >> between the stacks? > > > > Well, actually it comes from lbox_func_call, I couldn't extract this > > into a separate helper. To be honest I do not really undertand why > > luaT_newthread is used in lbox_func_call but I presume this is the > > template of calling external functions in Lua? > > We don't copy code presuming that it does something. Lets better > understand why is it needed instead of blindly copying it. > Currently I don't see any reason why is it needed. > > Tbh I don't know why is it needed in lbox_func_call() either. The > comment there is super unclear about that. It just says what is > done, and not why. I presume it is because of coio thread, will take more precise look once I manage with general api.