[PATCH] Drop const qualifier of struct tuple

Vladimir Davydov vdavydov.dev at gmail.com
Fri Apr 5 14:46:28 MSK 2019


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.



More information about the Tarantool-patches mailing list