comctl32: realloc or free and alloc

Vitaliy Margolen wine-devel at kievinfo.com
Sun May 1 12:44:02 CDT 2011


On 05/01/2011 10:29 AM, Alexey Fisher wrote:
> Correct me if I'm wrong. You can't ReAlloc pointer only if you allocated
> the memory by Alloc. At least for glibc.

First of all we talking about Wine's functions HeapAlloc, HeapReAlloc, and 
HeapFree.

The HeapReAlloc can and does re-allocate memory initially allocated by 
HeapAlloc. However it can not allocate memory first time around - calling 
HeapReAlloc with null src pointer is an error.

What Dan was talking about - HeapReAlloc will attempt to reuse the same 
memory if new size is same or smaller then current size. This can 
significantly improve performance.

Vitaliy.



More information about the wine-devel mailing list