valloc(3)
Name
valloc − aligned memory allocator
Syntax
#include <stdlib.h>
void *valloc(size)
size_t size;
Description
The valloc subroutine allocates size bytes aligned on a page boundary. It is implemented by calling malloc() with a slightly larger request, saving the true beginning of the block allocated, and returning a properly aligned pointer.
Diagnostics
The valloc subroutine returns a null pointer (0) if there is no available memory or if the arena has been detectably corrupted by storing outside the bounds of a block. The valloc subroutine will fail and no additional memory will be allocated if one of the following is true:
[ENOMEM] The limit, as set by setrlimit(,), is exceeded.
[ENOMEM] The maximum possible size of a data segment (compiled into the system) is exceeded.
[ENOMEM] Insufficient space exists in the swap area to support the expansion.