---
name: "valloc"
section: "3"
platform: "linux"
package: "man-pages"
version: "6.19-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/valloc"
---

# valloc(3)

page-aligned memory allocation

## NAME

valloc - page-aligned memory allocation

## LIBRARY

Standard C library (*libc*, *-lc*)

## SYNOPSIS

```
#include <stdlib.h>
```

**\[\[deprecated\]\] void \*valloc(size\_t** *size***);**

Feature Test Macro Requirements for glibc (see [**feature\_test\_macros**(7)](/feature_test_macros/7.md)):

**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
```

## DESCRIPTION

**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)*.

## ATTRIBUTES

For an explanation of the terms used in this section, see [**attributes**(7)](/attributes/7.md).

| | | |
| --- | --- | --- |
| **Interface** | **Attribute** | **Value** |
| **valloc**() | Thread safety | MT-Unsafe init |

## VERSIONS

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).

## STANDARDS

BSD, GNU.

## HISTORY

glibc 2.0. 3.0BSD. Documented as obsolete in 4.3BSD, and as legacy in SUSv2.

## CAVEATS

See [**memalign**(3)](/memalign/3.md).

## SEE ALSO

[**memalign**(3)](/memalign/3.md)
