[Tarantool-patches] [PATCH v4 4/6] sql: use parser's region of "index" array

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Fri Sep 25 00:30:39 MSK 2020


On 23.09.2020 16:25, Roman Khabibov wrote:
> Hi Thanks for the review.
> 
>> On Sep 17, 2020, at 17:53, Vladislav Shpilevoy <v.shpilevoy at tarantool.org> wrote:
>>
>> Thanks for the patch!
>>
>> On 11.09.2020 23:51, Roman Khabibov wrote:
>>> Allocate memory for the "index" array of ephemeral space on the
>>> parser's region instead of a heap as it was before. Fixed a memory
>>> leak that realloc() generated.
>>
>> You need to provide more info why it can't be stored on the heap,
>> and why free() can't be simply called somewhere.
> Actually, it can be stored on the heap. I thought that getting rid
> of malloc/free is the main point of using region.

Main point of the region - speed, and it is also harder to leave
a memory leak, because the region is destroyed in the end of parsing
entirely.

> The region is also
> well suited for this task, because space-> index is information that
> is needed only for parsing and should be destroyed with parsed. I dropped
> this patch and added free in the new patch.

Well, you could also make a patch which makes the parser space use the
region. No need to hurry making a patch to make the questions gone.


More information about the Tarantool-patches mailing list