Page 1 of 1

malloc/free problem

Posted: Fri Jun 27, 2008 11:14 am
by DarkJarek
Hi, I'm writing malloc and have problem how do it.
I have 2 ideas:

1.
-free blocks will be linked in 2-direction list
-when i want alloc block, malloc searching list for first free fit block
-when i want to free block, free function add it to list at beginning
-sometimes list have been sorted and neighbouring block have been marged

2.
similarly as above but:
-list are always sorted

3.
Maybe there are better way :)

Re: malloc/free problem

Posted: Fri Jun 27, 2008 11:15 am
by Combuster
dlmalloc :wink: