[RFC 4/4] eal/malloc: remove type argument from internal malloc routines

Tyler Retzlaff roretzla at linux.microsoft.com
Fri Apr 26 18:16:27 CEST 2024


On Thu, Apr 25, 2024 at 11:24:01AM -0700, Stephen Hemminger wrote:
> The type argument is carried through malloc heap routines but
> never used.
> 
> Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
> ---
>  lib/eal/common/eal_common_memzone.c  |  6 ++---
>  lib/eal/common/malloc_heap.c         | 39 ++++++++++++----------------
>  lib/eal/common/malloc_heap.h         |  7 +++--
>  lib/eal/common/rte_malloc.c          | 16 +++++-------
>  lib/eal/include/eal_trace_internal.h |  4 +--
>  5 files changed, 29 insertions(+), 43 deletions(-)
> 
> diff --git a/lib/eal/common/eal_common_memzone.c b/lib/eal/common/eal_common_memzone.c
> index 32e6b78f87..2d9b6aa3e3 100644
> --- a/lib/eal/common/eal_common_memzone.c
> +++ b/lib/eal/common/eal_common_memzone.c
> @@ -191,14 +191,12 @@ memzone_reserve_aligned_thread_unsafe(const char *name, size_t len,
>  	if (len == 0 && bound == 0) {
>  		/* no size constraints were placed, so use malloc elem len */
>  		requested_len = 0;
> -		mz_addr = malloc_heap_alloc_biggest(NULL, socket_id, flags,
> -				align, contig);
> +		mz_addr = malloc_heap_alloc_biggest(socket_id, flags, align, contig);

i may have missed if this was discussed already. for the public api i
understand for now we need to keep the unused parameter in the function
signatures but for internal api/functions i would prefer the parameter
be removed entirely.

also somewhat related side-note i don't think msvc has a way of marking
function parameters unused as is done with __rte_unused. currently i
expand the macro empty and suppress the warning globally which is not
great.



More information about the dev mailing list