valloc - page-aligned memory allocator (LEGACY)
#include <stdlib.h> void *valloc(size_t size);
The valloc() function has the same effect as malloc(), except that the allocated memory will be aligned to a multiple of the value returned by sysconf(_SC_PAGESIZE).This interface need not be reentrant.
Upon successful completion, valloc() returns a pointer to the allocated memory. Otherwise, valloc() returns a null pointer and sets errno to indicate the error.If size is 0, the behaviour is implementation-dependent; the value returned will be either a null pointer or a unique pointer. When size is 0 and valloc() returns a null pointer, errno is not modified.
The valloc() function will fail if:
- [ENOMEM]
- Storage space available is insufficient.
None.
Applications should avoid using valloc() but should use malloc() or mmap() instead. On systems with a large page size, the number of successful valloc() operations may be zero.
None.
malloc(), sysconf(), <stdlib.h>.