[PATCH] eal/windows: fix memory management macros usage

Tyler Retzlaff roretzla at linux.microsoft.com
Tue Nov 14 18:46:37 CET 2023


On Tue, Nov 14, 2023 at 07:05:29PM +0200, Gregory Etelson wrote:
> Windows compilation with cross-mingw on Fedora 39 failed
> because MEM_REPLACE_PLACEHOLDER and MEM_RESERVE_PLACEHOLDER were
> already defined in the compiler environment:
> 
> eal_memory.c:77: error: "MEM_REPLACE_PLACEHOLDER" redefined
> /usr/x86_64-w64-mingw32/sys-root/mingw/include/winnt.h:5710: note:
> this is the location of the previous definition
> 
> eal_memory.c:78: error: "MEM_RESERVE_PLACEHOLDER" redefined
> /usr/x86_64-w64-mingw32/sys-root/mingw/include/winnt.h:5715: note:
> this is the location of the previous definition
> 
> The patch masks MEM_REPLACE_PLACEHOLDER and MEM_RESERVE_PLACEHOLDER
> macros if they were pre-defined by compiler.
> 
> The patch also masks MEM_COALESCE_PLACEHOLDERS and
> MEM_PRESERVE_PLACEHOLDER to prevent similar errors.
> 
> Fixes: 2a5d547a4a9b ("eal/windows: implement basic memory management")
> 
> Cc: stable at dpdk.org
> Signed-off-by: Gregory Etelson <getelson at nvidia.com>
> ---

since we are duplicating something that comes from something else that
has been duplicated out of windows WDK here it might be a reasonable
safety check to verify that our duplicated values match our
expectations?

#ifndef MEM_COALESCE_PLACEHOLDERS
#define MEM_COALESCE_PLACEHOLDERS 0x00000001
#else
static_assert(MEM_COALESCE_PLACEHOLDERS == 0x00000001, "...")
#endif

either way, this is straight forward.

Acked-by: Tyler Retzlaff <roretzla at linux.microsoft.com>



More information about the stable mailing list