Jacek Caban jacek@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.