[PATCH] vbscript: Replace custom buffer management code by BSTR based helper.

Dmitry Timoshkov dmitry at baikal.ru
Wed Oct 23 06:33:30 CDT 2019


Jacek Caban <jacek at codeweavers.com> wrote:

> The problem with using BSTRs is that you need to realloc every time 
> something is appended. In cases like [1], the current approach uses one 
> heap_alloc and one SysAllocString. You patch would need one 
> SysAllocString and 6 reallocation.

This is an optimization that could be done in a similar way as strbuf_ensure_size()
currently does: double the size of an allocated BSTR instead of allocating
exactly old + new bytes for the final string. I can send an improved version
of the patch if desired.

-- 
Dmitry.



More information about the wine-devel mailing list