0

malloc/free with memory coalescing

Original heap_2.c malloc/free code modified to coalesce two neighbours freed chunks of memory.

The free list is not still ordered by size but is ordered by address (to speed up the coalescing). The malloc-ed area is searched by first fit algorithm.

The code lets you choose to use the previous version or the coalescing one. To use the previous version simply #define USE_ORDER_BY_SIZE.

 

Eng. PhD. Antonio Barbalace




heap_2.c

0 comments

Please sign in to leave a comment.