On 25 Oct 2018, at 14:48, Gabriel Ivăncescu gabrielopcode@gmail.com wrote:
On Thu, Oct 25, 2018 at 3:43 PM Huw Davies huw@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.