|
@@ -24,6 +24,7 @@
|
|
|
#if defined (COALESCING_FIXED) || defined (COALESCING_VARIABLE)
|
|
|
#include "coalesce.h"
|
|
|
#endif /* COALESCING_FIXED || COALESCING_VARIABLE */
|
|
|
+#include "linked_lists/add_block.h"
|
|
|
#ifdef WITH_ADAPTIVITY
|
|
|
#include "dmm_adaptor.h"
|
|
|
#endif /* WITH_ADAPTIVITY */
|
|
@@ -175,7 +176,19 @@ void custom_ahfree(allocator_t *allocator, heap_t* heap, void *ptr) {
|
|
|
current_maptable_node = current_maptable_node->next;
|
|
|
}
|
|
|
}
|
|
|
- push_block(&ptr, ¤t_maptable_node->fixed_list_head);
|
|
|
+#ifdef COUNT_HOPS
|
|
|
+#ifdef FIFO_SORT_POLICY
|
|
|
+ add_block(heap, &ptr, ¤t_maptable_node->fixed_list_head, ¤t_maptable_node->fixed_list_tail);
|
|
|
+#else /* FIFO_SORT_POLICY */
|
|
|
+ add_block(heap, &ptr, ¤t_maptable_node->fixed_list_head);
|
|
|
+#endif /* FIFO_SORT_POLICY */
|
|
|
+#else /* COUNT_HOPS */
|
|
|
+#ifdef FIFO_SORT_POLICY
|
|
|
+ add_block(&ptr, ¤t_maptable_node->fixed_list_head, ¤t_maptable_node->fixed_list_tail);
|
|
|
+#else /* FIFO_SORT_POLICY */
|
|
|
+ add_block(&ptr, ¤t_maptable_node->fixed_list_head);
|
|
|
+#endif /* FIFO_SORT_POLICY */
|
|
|
+#endif /* COUNT_HOPS */
|
|
|
} else { /* put it in the free list */
|
|
|
#endif /* WITH_FIXED_LISTS */
|
|
|
#if defined (COALESCING_FIXED) || defined (COALESCING_VARIABLE)
|
|
@@ -183,10 +196,34 @@ void custom_ahfree(allocator_t *allocator, heap_t* heap, void *ptr) {
|
|
|
* coalesced
|
|
|
*/
|
|
|
if(!coalesced) {
|
|
|
- push_block(&ptr, &heap->free_list_head);
|
|
|
+#ifdef COUNT_HOPS
|
|
|
+#ifdef FIFO_SORT_POLICY
|
|
|
+ add_block(heap, &ptr, &heap->free_list_head, &heap->free_list_tail);
|
|
|
+#else /* FIFO_SORT_POLICY */
|
|
|
+ add_block(heap, &ptr, &heap->free_list_head);
|
|
|
+#endif /* FIFO_SORT_POLICY */
|
|
|
+#else /* COUNT_HOPS */
|
|
|
+#ifdef FIFO_SORT_POLICY
|
|
|
+ add_block(&ptr, &heap->free_list_head, &heap->free_list_tail);
|
|
|
+#else /* FIFO_SORT_POLICY */
|
|
|
+ add_block(&ptr, &heap->free_list_head);
|
|
|
+#endif /* FIFO_SORT_POLICY */
|
|
|
+#endif /* COUNT_HOPS */
|
|
|
}
|
|
|
-#else
|
|
|
- push_block(&ptr, &heap->free_list_head);
|
|
|
+#else /* COALESCING_FIXED || COALESCING_VARIABLE */
|
|
|
+#ifdef COUNT_HOPS
|
|
|
+#ifdef FIFO_SORT_POLICY
|
|
|
+ add_block(heap, &ptr, &heap->free_list_head, &heap->free_list_tail);
|
|
|
+#else /* FIFO_SORT_POLICY */
|
|
|
+ add_block(heap, &ptr, &heap->free_list_head);
|
|
|
+#endif /* FIFO_SORT_POLICY */
|
|
|
+#else /* COUNT_HOPS */
|
|
|
+#ifdef FIFO_SORT_POLICY
|
|
|
+ add_block(&ptr, &heap->free_list_head, &heap->free_list_tail);
|
|
|
+#else /* FIFO_SORT_POLICY */
|
|
|
+ add_block(&ptr, &heap->free_list_head);
|
|
|
+#endif /* FIFO_SORT_POLICY */
|
|
|
+#endif /* COUNT_HOPS */
|
|
|
#endif /* COALESCING_FIXED || COALESCING_VARIABLE */
|
|
|
#ifdef WITH_FIXED_LISTS
|
|
|
}
|