[1/4] eal: fix list index for 256 byte element
Checks
Commit Message
Elements with 2^8B size should fall into index 1 of the list.
Fixes: f62f4a375ff4 ("malloc: optimize 4K allocations")
Cc: changfengnan@bytedance.com
Cc: stable@dpdk.org
Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
lib/eal/common/malloc_elem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 5/19/2023 5:29 AM, Ruifeng Wang wrote:
> Elements with 2^8B size should fall into index 1 of the list.
>
> Fixes: f62f4a375ff4 ("malloc: optimize 4K allocations")
> Cc: changfengnan@bytedance.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
> ---
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
@@ -382,7 +382,7 @@ malloc_elem_free_list_index(size_t size)
size_t log2;
size_t index;
- if (size <= (1UL << MALLOC_MINSIZE_LOG2))
+ if (size < (1UL << MALLOC_MINSIZE_LOG2))
return 0;
/* Find next power of 2 > size. */