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:
parent
a712373138
commit
aad5c04223
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user