25 Oct
2018
25 Oct
'18
2:58 p.m.
On 25 Oct 2018, at 14:48, Gabriel Ivăncescu <gabrielopcode(a)gmail.com> wrote:
On Thu, Oct 25, 2018 at 3:43 PM Huw Davies <huw(a)codeweavers.com> wrote:
Why don't you add them to a contiguous array as you go, by realloc'ing the array. This would avoid all this complicated block stuff (and if the reallocs don't need to move, you avoid the copy).
Wouldn't that be a problem if there's a lot of strings to enumerate? There will be a huge amount of reallocations. Obviously, it's only in *those* cases that performance even matters, not when the amount of strings is small (thinking in range about 500k or more).
Not if you grow the alloc size exponentially. Huw.