From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp43.i.mail.ru (smtp43.i.mail.ru [94.100.177.103]) (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 198EE4696C3 for ; Mon, 20 Apr 2020 04:15:37 +0300 (MSK) Date: Mon, 20 Apr 2020 01:15:37 +0000 From: Nikita Pettik Message-ID: <20200420011537.GB25021@tarantool.org> References: <878773d43bdc79130168b0beaf4e20aed795ddad.1587154034.git.korablev@tarantool.org> <0c99f856-c946-06bc-e87a-a95a87ea6eaa@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <0c99f856-c946-06bc-e87a-a95a87ea6eaa@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH v2 1/2] box/error: don't allow overflow of error ref counter List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy Cc: tarantool-patches@dev.tarantool.org On 18 Apr 01:54, Vladislav Shpilevoy wrote: > Hi! Thanks for the patch! > > Maybe just make the ref counter uint64_t? It will never > overflow then, and the patch would become of 2 lines. "Explicit is better than implicit", so I'd prefer explicit error raising rather than silent reducing counter modulo 2^64. What is more, making counter unsigned still don't resolve all problems: reset would result in premature error destruction meanwhile some Lua object still accessing it.