|
@@ -15,6 +15,8 @@ void * coalesce(void *ptr, heap_t *heap) {
|
|
|
}
|
|
|
|
|
|
// Try to coalesce with the previous memory block
|
|
|
+ // FIXME What happens if we have multiple heaps and we don't know the
|
|
|
+ // owner of the blocks?
|
|
|
if(is_previous_free(ptr)) {
|
|
|
prev = get_previous(ptr);
|
|
|
|
|
@@ -25,8 +27,7 @@ void * coalesce(void *ptr, heap_t *heap) {
|
|
|
current_maptable_node = heap->maptable_head;
|
|
|
if(fixed_list_id != 0) {
|
|
|
for(i = 1; i < fixed_list_id; i++) {
|
|
|
- current_maptable_node =
|
|
|
- current_maptable_node->next;
|
|
|
+ current_maptable_node = current_maptable_node->next;
|
|
|
}
|
|
|
}
|
|
|
remove_block(ptr, current_maptable_node->fixed_list_head);
|