On 04-Apr-18 12:32 AM, Stephen Hemminger wrote:
On Wed,  4 Apr 2018 00:21:15 +0100
Anatoly Burakov <anatoly.bura...@intel.com> wrote:

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.bura...@intel.com>

Dummy element at end of heap could be helpful for purify/valgrind style 
verification
that code does not exceed allocation.


It would interfere with removing pages from memory :) Dummy element needs to be stored somewhere - if it's stored in a page, that means that page cannot be freed. Moreover, with pages being added/removed dynamically, the dummy element will have to be moved back and forth, so "at the end of the heap" is not a fixed location.

--
Thanks,
Anatoly

Reply via email to