malloc: make heap a doubly-linked list
authorAnatoly Burakov <anatoly.burakov@intel.com>
Wed, 11 Apr 2018 12:29:38 +0000 (13:29 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 11 Apr 2018 17:37:46 +0000 (19:37 +0200)
commitbb372060dad4f7639c18801d0048b1a3af8a74b0
tree469c233e570911fd54e4020974eb6c4bee0cb2f4
parentb5dd92226f45db892e955834a0e030da7658ba31
malloc: make heap a doubly-linked list

As we are preparing for dynamic memory allocation, we need to be
able to handle holes in our malloc heap, hence we're switching to
doubly linked list, and prepare infrastructure to support it.

Since our heap is now aware where are our first and last elements,
there is no longer any need to have a dummy element at the end of
each heap, so get rid of that as well. Instead, let insert/remove/
join/split operations handle end-of-list conditions automatically.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Tested-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Tested-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Tested-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
lib/librte_eal/common/include/rte_malloc_heap.h
lib/librte_eal/common/malloc_elem.c
lib/librte_eal/common/malloc_elem.h
lib/librte_eal/common/malloc_heap.c