From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Fri, 5 Apr 2019 14:46:28 +0300 From: Vladimir Davydov Subject: Re: [PATCH] Drop const qualifier of struct tuple Message-ID: <20190405114628.ah3upqd5yopc5pcg@esperanza> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: To: kostja.osipov@gmail.com Cc: tarantool-patches@freelists.org List-ID: On Fri, Apr 05, 2019 at 02:31:06PM +0300, Vladimir Davydov wrote: > Using the const qualifier for complex structures like tuple is bad. > We already have to cast it to drop the const qualifier now and then, > e.g. to increment/decrement the reference counter. > > We are planning to wrap struct tuple in a helper struct (aka entry) to > store it in vinyl containers along with a comparison hint (cache, memory > tree, etc). We will be passing this struct by value so we won't be able > to retain const qualifier, because in contrast to a const pointer, one > must initialize a const struct upon definition. > > That said, it's time to drop const qualifier of struct tuple everywhere, > like we have already done in case of struct key_def and tuple_format. Kostja approved verbally. Pushed to master.