From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Thu, 25 Jul 2019 00:07:31 +0300 From: Konstantin Osipov Subject: Re: [PATCH v4 4/4] box: introduce functional indexes Message-ID: <20190724210731.GA11790@atlas> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: To: Kirill Shcherbatov Cc: tarantool-patches@freelists.org, vdavydov.dev@gmail.com List-ID: * Kirill Shcherbatov [19/07/24 10:38]: > +/** > + * Execute a given function (a functional index function) and > + * return an extracted key_data and key_data_sz and count of > + * extracted keys. > + * > + * Returns not NULL key_data pointer in case of success. > + * Routine allocates memory on fiber's region. > + */ > +const char * > +func_key_extract(struct tuple *tuple, struct func *func, > + const char **data_end, uint32_t *key_count); Please pass the allocator explicitly. I don't understand why you force the user of this module to first create a temporary buffer, then iterate over this buffer to create hint objects. Why can't this function return an iterator right away, and the iterator itself could return hint_t objects already, not individual keys? -- Konstantin Osipov, Moscow, Russia