[PATCH] oleaut32: Use the global HeapAlloc() wrappers

Huw Davies huw at codeweavers.com
Mon Feb 5 02:49:35 CST 2018


On Sat, Feb 03, 2018 at 12:17:55AM +0100, Michael Stefaniuc wrote:
> Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
> ---
>  dlls/oleaut32/typelib.c |  1 +
>  dlls/oleaut32/typelib.h | 20 --------------------
>  2 files changed, 1 insertion(+), 20 deletions(-)
> 
> diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
> index 49366aeecd..4ee6aa540d 100644
> --- a/dlls/oleaut32/typelib.c
> +++ b/dlls/oleaut32/typelib.c
> @@ -73,6 +73,7 @@
>  #include "typelib.h"
>  #include "wine/debug.h"
>  #include "variant.h"
> +#include "wine/heap.h"
>  #include "wine/list.h"
>  
>  WINE_DEFAULT_DEBUG_CHANNEL(ole);
> diff --git a/dlls/oleaut32/typelib.h b/dlls/oleaut32/typelib.h
> index d977dfb063..2003c75556 100644
> --- a/dlls/oleaut32/typelib.h
> +++ b/dlls/oleaut32/typelib.h
> @@ -596,26 +596,6 @@ WORD typeofarray
>  
>  #include "poppack.h"
>  
> -static inline void* __WINE_ALLOC_SIZE(1) heap_alloc( SIZE_T size )
> -{
> -    return HeapAlloc( GetProcessHeap(), 0, size );
> -}
> -
> -static inline void* __WINE_ALLOC_SIZE(1) heap_alloc_zero( SIZE_T size )
> -{
> -    return HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, size );
> -}
> -
> -static inline void* __WINE_ALLOC_SIZE(2) heap_realloc( LPVOID mem, SIZE_T size )
> -{
> -    return HeapReAlloc( GetProcessHeap(), 0, mem, size );
> -}

While you're converting heap_realloc() to the alloc on mem == NULL
behaviour, wouldn't it make sense to simplify any callers that do
this manually?  There are several in typelib.c .  It's obviously
possible to do later, but they're easier to find now before making
this change.

Huw.



More information about the wine-devel mailing list