From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp36.i.mail.ru (smtp36.i.mail.ru [94.100.177.96]) (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 444D0446427 for ; Tue, 31 Mar 2020 02:25:00 +0300 (MSK) References: <26c794f2c6fcca11d202f0fbf3b41b9490bf780c.1585097339.git.korablev@tarantool.org> From: Vladislav Shpilevoy Message-ID: <1a94ba64-ac51-9320-12b3-433dbd9f82fa@tarantool.org> Date: Tue, 31 Mar 2020 01:24:58 +0200 MIME-Version: 1.0 In-Reply-To: <26c794f2c6fcca11d202f0fbf3b41b9490bf780c.1585097339.git.korablev@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH v2 08/10] box/error: clarify purpose of reference counting in struct error List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nikita Pettik , tarantool-patches@dev.tarantool.org LGTM, you can push this out of order. On 25/03/2020 02:43, Nikita Pettik wrote: > --- > src/lib/core/diag.h | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/src/lib/core/diag.h b/src/lib/core/diag.h > index 675b9c6f1..665f492fa 100644 > --- a/src/lib/core/diag.h > +++ b/src/lib/core/diag.h > @@ -71,6 +71,15 @@ struct error { > error_f raise; > error_f log; > const struct type_info *type; > + /** > + * Reference counting is basically required since > + * instances of this structure are available in Lua > + * as well (as cdata with overloaded fields and methods > + * by the means of introspection). Thus, it may turn > + * out that Lua's GC attempts at releasing object > + * meanwhile it is still used in C internals or vice > + * versa. For details see luaT_pusherror(). > + */ > int refs; > /** > * Errno at the moment of the error >