|
@@ -8,14 +8,14 @@
|
|
|
#endif /* SPLITTING_FIXED || SPLITTING_VARIABLE */
|
|
|
#include <dmmlib/initialize_allocator.h>
|
|
|
#include "other.h"
|
|
|
+#include "sll/search_on_fixed.h"
|
|
|
#include "sys_alloc.h"
|
|
|
#include "block_header.h"
|
|
|
#include "dmm_adaptor.h"
|
|
|
|
|
|
void * custom_ahmalloc(allocator_t* allocator, heap_t* heap, size_t size) {
|
|
|
void *ptr;
|
|
|
- int heap_id, fixed_list_id, i;
|
|
|
- maptable_node_t *current_maptable_node;
|
|
|
+ int heap_id;
|
|
|
void *current_block, *previous_block;
|
|
|
#if defined (SPLITTING_FIXED) || defined (SPLITTING_VARIABLE)
|
|
|
size_t new_size;
|
|
@@ -46,23 +46,7 @@ void * custom_ahmalloc(allocator_t* allocator, heap_t* heap, size_t size) {
|
|
|
posix_lock(heap);
|
|
|
#endif /* HAVE_LOCKS */
|
|
|
|
|
|
- /* Perform exact fit to fixed lists */
|
|
|
- fixed_list_id = map_size_to_list(heap, req_padding(size));
|
|
|
-
|
|
|
- /* If a fixed list is found, do a first fit */
|
|
|
- if(fixed_list_id != -1) {
|
|
|
- current_maptable_node = heap->maptable_head;
|
|
|
- /* traverse through the maptable node list */
|
|
|
- if(fixed_list_id != 0) {
|
|
|
- for(i = 1; i < fixed_list_id; i++) {
|
|
|
- current_maptable_node = current_maptable_node->next;
|
|
|
- }
|
|
|
- }
|
|
|
- if(current_maptable_node->fixed_list_head != NULL) {
|
|
|
- ptr = current_maptable_node->fixed_list_head;
|
|
|
- current_maptable_node->fixed_list_head = get_next(ptr);
|
|
|
- }
|
|
|
- }
|
|
|
+ ptr = search_on_fixed(heap, req_padding(size));
|
|
|
|
|
|
if(ptr == NULL) {
|
|
|
|