[dpdk-dev] [PATCH 08/41] eal: make malloc free return resulting malloc element

Olivier Matz olivier.matz at 6wind.com
Mon Mar 19 18:34:57 CET 2018


On Sat, Mar 03, 2018 at 01:45:56PM +0000, Anatoly Burakov wrote:
> Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
> ---
>  lib/librte_eal/common/malloc_elem.c | 4 ++--
>  lib/librte_eal/common/malloc_elem.h | 2 +-
>  lib/librte_eal/common/malloc_heap.c | 4 ++--
>  3 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/lib/librte_eal/common/malloc_elem.c b/lib/librte_eal/common/malloc_elem.c
> index 008f5a3..c18f050 100644
> --- a/lib/librte_eal/common/malloc_elem.c
> +++ b/lib/librte_eal/common/malloc_elem.c
> @@ -379,7 +379,7 @@ malloc_elem_join_adjacent_free(struct malloc_elem *elem)
>   * blocks either immediately before or immediately after newly freed block
>   * are also free, the blocks are merged together.
>   */
> -int
> +struct malloc_elem *
>  malloc_elem_free(struct malloc_elem *elem)
>  {
>  	void *ptr;
> @@ -397,7 +397,7 @@ malloc_elem_free(struct malloc_elem *elem)
>  
>  	memset(ptr, 0, data_len);
>  
> -	return 0;
> +	return elem;
>  }
>  
>  /*

An explanation about why this change is needed would make sense I think.

Thanks,
Olivier


More information about the dev mailing list