[tarantool-patches] Re: [PATCH 1/1] core: introduce tt_static_sized_buf()
Konstantin Osipov
kostja at tarantool.org
Sun Apr 28 00:18:03 MSK 2019
* Vladislav Shpilevoy <v.shpilevoy at tarantool.org> [19/04/27 15:39]:
To solve your particular problem, you could simply increase the
static buffer size. This is a one-line patch. I suggest you do it
in scope of swim and be done with it.
Here is why:
Essentially, you introduce a new allocator. A very useful one,
indeed, but the protocol should follow one of an allocator, e.g.
provide alloc, realloc, and a (no-op) free. The allocator itself
should be moved to small/. You should check boundary conditions -
e.g. attempt to allocate more memory than the maximal size of the
static array - and return 0. tt_static_buf() then can be replaced
with static_alloc(desired size).
If you wish to do all of the above in a separate patch - you're
more than welcome.
--
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
More information about the Tarantool-patches
mailing list