[PATCH v2 1/4] shell32/autocomplete: Implement a cache and sort the enumerated strings for proper behavior

Huw Davies huw at codeweavers.com
Thu Oct 25 09:58:13 CDT 2018


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




More information about the wine-devel mailing list