|
@@ -139,7 +139,9 @@ void * custom_ahrealloc(allocator_t *allocator, heap_t *heap, void *ptr, size_t
|
|
|
if(allocator->border_ptr == next_block) {
|
|
|
allocator->border_ptr = ptr;
|
|
|
}
|
|
|
- set_size_and_used(allocator, ptr, size);
|
|
|
+ set_size_and_used(allocator,
|
|
|
+ ptr,
|
|
|
+ old_size + get_size(next_block) + HEADER_SIZE);
|
|
|
|
|
|
#if defined (SPLITTING_FIXED) || defined (SPLITTING_VARIABLE)
|
|
|
#ifdef SPLITTING_FIXED
|
|
@@ -149,8 +151,7 @@ void * custom_ahrealloc(allocator_t *allocator, heap_t *heap, void *ptr, size_t
|
|
|
min_split_size = heap->dmm_knobs.min_split_size;
|
|
|
#endif /* SPLITTING_VARIABLE */
|
|
|
|
|
|
- if(old_size + get_size(next_block) - size >=
|
|
|
- min_split_size) {
|
|
|
+ if(get_size(ptr) - size >= min_split_size) {
|
|
|
split(allocator, heap, ptr, size);
|
|
|
}
|
|
|
#endif /* (SPLITTING_FIXED) || (SPLITTING_VARIABLE) */
|