[PATCH 1/4] include: Add generic HeapAlloc() wrappers
Henri Verbeet
hverbeet at gmail.com
Thu Jan 25 17:30:05 CST 2018
On 25 January 2018 at 23:25, Michael Stefaniuc <mstefani at winehq.org> wrote:
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
Strictly speaking that's superfluous for internal headers (and more so
for ones that only contain static inline functions), I think.
> +static inline void * __WINE_ALLOC_SIZE(2) heap_realloc(void *mem, SIZE_T len)
> +{
> + if (mem)
> + return HeapReAlloc(GetProcessHeap(), 0, mem, len);
> + else
> + return HeapAlloc(GetProcessHeap(), 0, len);
> +}
I'm partial to
if (!mem)
return HeapAlloc(...);
return HeapReAlloc(...);
but that's purely stylistic, and perhaps a preference that's not
universally shared.
More information about the wine-devel
mailing list