Change a malloc() to a HeapAlloc()

Octavian Voicu octavian.voicu at gmail.com
Wed Jun 9 13:45:56 CDT 2010


On Wed, Jun 9, 2010 at 9:08 PM, Peter Davies <ultratwo at gmail.com> wrote:
>> The patch is also wrong.
> Why? What difference does malloc() over HeapAlloc() make? (this is arguably a
> case for not sending the patch in the first place)

This is because wpp_lookup_mem is only referenced in the wpp_callbacks
structure, which is passed to wpp_set_callbacks.

Code where callbacks are set and invoked is in libs/wpp/, which is a
native library (will not compile to a dll), so it will clean up using
standard free().

HeapAlloc/HeapFree should always be used in windows-based code, except
when it interfaces with other code that doesn't. In any case,
HeapAlloc/HeapFree and malloc/free should never be mixed up (allocate
with one, free with the other).

Octavian



More information about the wine-devel mailing list