Add valloc() and posix_memalign() to malloc debug heap.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32954 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz 2009-09-06 05:13:01 +00:00
parent a712373138
commit aad5c04223
1 changed files with 21 additions and 0 deletions

View File

@ -1752,3 +1752,24 @@ calloc(size_t numElements, size_t size)
return address;
}
extern "C" void *
valloc(size_t size)
{
return memalign(B_PAGE_SIZE, size);
}
extern "C" int
posix_memalign(void **pointer, size_t alignment, size_t size)
{
if (!is_valid_alignment(alignment))
return EINVAL;
*pointer = memalign(alignment, size);
if (*pointer == NULL)
return ENOMEM;
return 0;
}