[Tarantool-patches] [PATCH small 1/1] region: new region_alloc_array, updated alloc_object
Timur Safin
tsafin at tarantool.org
Fri Jun 5 15:11:52 MSK 2020
: From: Vladislav Shpilevoy <v.shpilevoy at tarantool.org>
: Subject: Re: [PATCH small 1/1] region: new region_alloc_array, updated
: alloc_object
:
...
: Worse again it becomes, when size is needed not only in diag, but
: also in case of success. For example, to make a memset(0). In this
: case it is either triple code duplication, or double code duplication
: but with size_t size/bsize variable anyway.
:
: region_alloc_object() got the out parameter to be consistent with
: region_alloc_array().
:
: I tried removing the out parameter, and it started looking worse.
Agreed, that if extra macro argument `size` would simplify the code
then it's a good thing, despite all apparent ugliness.
Timur
More information about the Tarantool-patches
mailing list