blob: abeb8b07fcf5c0f8a75a2e7181598b642ef191b1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
/*
* valloc.c - emulate valloc() since bionic doesn't supply this function
*/
#include <stdlib.h>
#include <malloc.h>
void *valloc(size_t size)
{
long pagesize = -1;
#ifdef _SC_PAGESIZE
pagesize = sysconf(_SC_PAGESIZE);
#endif
if (pagesize < 0)
pagesize = 4096;
return memalign(pagesize, size);
}
|