[Tarantool-patches] [PATCH v2 08/10] box/error: clarify purpose of reference counting in struct error

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Tue Mar 31 02:24:58 MSK 2020


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
> 


More information about the Tarantool-patches mailing list