Bug 526152: make jemalloc's memalign support alignments less than pointer size, r=pavlov

This commit is contained in:
David Mandelin 2009-11-03 18:19:58 -08:00
parent 9a8cd700b7
commit e1654c8442

View File

@ -5797,14 +5797,14 @@ memalign(size_t alignment, size_t size)
{
void *ret;
assert(((alignment - 1) & alignment) == 0 && alignment >=
sizeof(void *));
assert(((alignment - 1) & alignment) == 0);
if (malloc_init()) {
ret = NULL;
goto RETURN;
}
alignment = alignment < sizeof(void*) ? sizeof(void*) : alignment;
ret = ipalloc(alignment, size);
RETURN: