NAME
valloc —
page-aligned memory allocator (LEGACY)
SYNOPSIS
#include <stdlib.h> void *valloc(size_t size);
DESCRIPTION
The valloc() function has the same effect as malloc(3) , 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.
RETURN VALUE
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.
ERRORS
The valloc() function will fail if:
- [ENOMEM]
- Storage space available is insufficient.
EXAMPLES
None.
APPLICATION USAGE
Applications should avoid using valloc() but should use malloc(3) or mmap(3) instead. On systems with a large page size, the number of successful valloc() operations may be zero.
FUTURE DIRECTIONS
None.
SEE ALSO
malloc(3) , sysconf(3) , <stdlib.h> .