Revert "malloc_debug: align allocations".

This reverts commit 217f090f9e.

At least for the guarded heap this completely defeats the purpose. If
software requires a certain alignment it should request it using
memalign explicitly instead of assuming it.
This commit is contained in:
Michael Lotz 2015-04-04 16:38:46 +02:00
parent 5ae3af6cc5
commit b0e31a9ce3
2 changed files with 5 additions and 5 deletions

View File

@ -966,7 +966,7 @@ memalign(size_t alignment, size_t size)
extern "C" void*
malloc(size_t size)
{
return memalign(size >= 8 ? 8 : 0, size);
return memalign(0, size);
}
@ -987,7 +987,7 @@ realloc(void* address, size_t newSize)
}
if (address == NULL)
return memalign(size >= 8 ? 8 : 0, newSize);
return memalign(0, newSize);
return guarded_heap_realloc(address, newSize);
}

View File

@ -1465,7 +1465,7 @@ heap_realloc(heap_allocator *heap, void *address, void **newAddress,
newSize -= sizeof(addr_t) + sizeof(heap_leak_check_info);
// if not, allocate a new chunk of memory
*newAddress = memalign(newSize >= 8 ? 8 : 0, newSize);
*newAddress = memalign(0, newSize);
if (*newAddress == NULL) {
// we tried but it didn't work out, but still the operation is done
return B_OK;
@ -1937,7 +1937,7 @@ malloc(size_t size)
if (sUseGuardPage)
return heap_debug_malloc_with_guard_page(size);
return memalign(size >= 8 ? 8 : 0, size);
return memalign(0, size);
}
@ -1978,7 +1978,7 @@ void *
realloc(void *address, size_t newSize)
{
if (address == NULL)
return memalign(newSize >= 8 ? 8 : 0, newSize);
return memalign(0, newSize);
if (newSize == 0) {
free(address);