diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2023-08-14 01:13:02 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2023-08-14 02:05:43 -0700 |
commit | 210580bb0bbd14c02c2ba929012399ec32885de1 (patch) | |
tree | b4172f1fffdb35e5782e4b976418d12f4ddebbf0 /src/modules/swarm/swarm.c | |
parent | ff272ab570f376224a96f83d2f185ad3796a9155 (diff) |
til_str: realloc in increasingly larger increments
Typically people do a exponential style growth in such
circumstances, but in my experience that tends to allocate nearly
double what's needed quite often.
Trying just a linearly increasing allocation size that bumps up
the minimum amount every time a resize is triggered. If the
needed amount exceeds the new growth increment, the larger value
is used, but the growth rate still follows the minimum bump.
I expect this to evolve more, just wanted to do something to
speed up til_str a bit from it's naive approach.
Diffstat (limited to 'src/modules/swarm/swarm.c')
0 files changed, 0 insertions, 0 deletions