The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group


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:
Storage space available is insufficient.




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.




malloc(), sysconf(), <stdlib.h>.

UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]