valloc
page-aligned memory allocation
- Provided by: manpages-dev (Version: 6.19-3)
- Source: manpages
- Report a bug
page-aligned memory allocation
Standard C library (libc, -lc)
#include <stdlib.h>
[[deprecated]] void *valloc(size_t size);
valloc():
Since glibc 2.12:
(_XOPEN_SOURCE >= 500) && !(_POSIX_C_SOURCE >= 200112L)
|| /* glibc >= 2.19: */ _DEFAULT_SOURCE
|| /* glibc <= 2.19: */ _SVID_SOURCE || _BSD_SOURCE
Before glibc 2.12:
_BSD_SOURCE || _XOPEN_SOURCE >= 500
valloc() allocates size bytes and returns a pointer to the allocated memory. The memory address will be a multiple of the page size.
It is equivalent to memalign(sysconf(_SC_PAGESIZE),size).
For an explanation of the terms used in this section, see attributes(7).
| Interface | Attribute | Value |
| valloc () | Thread safety | MT-Unsafe init |
According to SUSv2, valloc() is declared in <stdlib.h>. glibc declares it in <malloc.h>, and also in <stdlib.h> if suitable feature test macros are defined (see above).
BSD, GNU.
glibc 2.0. 3.0BSD. Documented as obsolete in 4.3BSD, and as legacy in SUSv2.
See memalign(3).