Take a shortcut when freeing in heap_realloc(), we already know the address belongs to our heap.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26200 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz 2008-07-01 20:18:02 +00:00
parent 291e114333
commit 86a38aedf4

View File

@ -1158,7 +1158,7 @@ heap_realloc(heap_allocator *heap, void *address, void **newAddress,
// copy the old data and free the old allocation // copy the old data and free the old allocation
memcpy(*newAddress, address, min_c(maxSize, newSize)); memcpy(*newAddress, address, min_c(maxSize, newSize));
free(address); heap_free(heap, address);
return B_OK; return B_OK;
} }