_Heap_Size_of_user_area question

Sergei Organov osv at topconrd.ru
Wed Jun 9 15:26:47 UTC 2004


"Thomas Rauscher" <trauscher at loytec.com> writes:
[...]
> Background: I was trying to improve realloc to handle the case of
> small increments or decrements. For example, asprintf does lots of
> small incrementing reallocs.

IMHO, the best implementation could be achieved by adding
_Heap_Realloc() function to the heap manager and just calling it from
the malloc module. Almost everything required is already there in the heap
manager, and it can quickly do reallocation even when the size requested
exceeds user area of currently allocated block but there is enough free
space next to the allocated block. That's impossible to do from outside
of the heap manager as far as I can tell.

-- 
Sergei.




More information about the users mailing list