Tarantool development patches archive
 help / color / mirror / Atom feed
From: Konstantin Osipov <kostja@tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Cc: tarantool-patches@freelists.org
Subject: [tarantool-patches] Re: [PATCH 1/1] core: introduce tt_static_sized_buf()
Date: Sun, 28 Apr 2019 00:18:03 +0300	[thread overview]
Message-ID: <20190427211803.GC5662@atlas> (raw)
In-Reply-To: <687f8dc3342a3e9b6d8138837646837d60e63ed8.1556315009.git.v.shpilevoy@tarantool.org>

* Vladislav Shpilevoy <v.shpilevoy@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

  reply	other threads:[~2019-04-27 21:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-26 21:44 [tarantool-patches] " Vladislav Shpilevoy
2019-04-27 21:18 ` Konstantin Osipov [this message]
2019-04-28 16:56   ` [tarantool-patches] " Vladislav Shpilevoy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190427211803.GC5662@atlas \
    --to=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='[tarantool-patches] Re: [PATCH 1/1] core: introduce tt_static_sized_buf()' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox