Browse Source

Fixed a bug involving the wrong indirection level in a pointer

tree_alloc
Thomas Johnson 1 year ago
parent
commit
843edec232
  1. 16
      tree_alloc.c

16
tree_alloc.c

@ -389,16 +389,16 @@ int add_new_region(Arena *arena, uintptr_t size, uintptr_t padding, uintptr_t al
while (head->right != NULL) {
head = head->right;
}
insert_right((TreeAlloc**) arena->root_freespace, (TreeAlloc*) newreg, (TreeAlloc*) head);
insert_right((TreeAlloc**) &arena->root_freespace, (TreeAlloc*) newreg, (TreeAlloc*) head);
}
#ifdef DEBUG
printf("= POST-REGION-CREATION =\n");
printf("==== FREESPACE TREE ====\n");
debug_print_tree(0, arena->root_freespace);
printf("==== TREEALLOC TREE ====\n");
debug_print_tree(0, arena->root_treealloc);
printf("===== END OF TREES =====\n");
printf("= POST-REGION-CREATION =\n");
printf("==== FREESPACE TREE ====\n");
debug_print_tree(0, arena->root_freespace);
printf("==== TREEALLOC TREE ====\n");
debug_print_tree(0, arena->root_treealloc);
printf("===== END OF TREES =====\n");
#endif
}
return 1;
}

Loading…
Cancel
Save