Commit bc1982aa authored by Bastien Legoy's avatar Bastien Legoy
Browse files

Buddy Finished

parent 193dcde8
......@@ -102,7 +102,6 @@ void efree_medium(Alloc a) {
{
// If Buddy is contained in the List:
// - remove Buddy from the list
// - add new block to next list
// - recursively call the next 'fusion'
if (head == buddy)
{
......@@ -110,14 +109,10 @@ void efree_medium(Alloc a) {
if (previous_head != NULL)
*(void**) previous_head = *(void**) head;
else arena.TZL[index] = *(void**) head;
// Add new Block
void* target_head = ((unsigned long)a.ptr < (unsigned long)buddy) ? a.ptr : buddy;
*(void**) target_head = arena.TZL[index + 1];
arena.TZL[index + 1] = target_head;
// Recursive Call
Alloc next = a;
next.size <<= 1;
next.ptr = target_head;
next.ptr = ((unsigned long)a.ptr < (unsigned long)buddy) ? a.ptr : buddy;
efree_medium(next);
return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment