eal/linux: change hugepage sorting to avoid overlapping memcpy
authorRalf Hoffmann <ralf.hoffmann@allegro-packets.com>
Thu, 7 Jan 2016 14:54:02 +0000 (15:54 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 3 Mar 2016 10:36:32 +0000 (11:36 +0100)
commita5f6b5ddca9617974321728eb0e2bc6098ad26ff
tree5fb19b0417bf8adbe13a4018dd2de191289ae091
parent3560681d68a16599e1b149799210b0de43c660aa
eal/linux: change hugepage sorting to avoid overlapping memcpy

with only one hugepage or already sorted hugepage addresses, the sort
function called memcpy with same src and dst pointer. Debugging with
valgrind will issue a warning about overlapping area. This patch changes
the sort method to qsort to avoid this behavior. The separate sort
function is no longer necessary.

Suggested-by: Jay Rolette <rolette@infiniteio.com>
Signed-off-by: Ralf Hoffmann <ralf.hoffmann@allegro-packets.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
lib/librte_eal/linuxapp/eal/eal_memory.c