pvalloc(3)
β¨ pvalloc β¨
okay bestie, so we're talking about pvalloc β the function that hands you page-sized, page-aligned memory. it's giving very specific, very picky, and honestly? iconic for it. π
π LIBRARY π
Standard C library (libc, -lc) π«Ά
πΈ SYNOPSIS πΈ
#include <malloc.h>
[[deprecated]] void *pvalloc(size_t size);
ngl, see that [[deprecated]] right there? yeah. the compiler is side-eyeing this function and so should you. β οΈ
π¦ DESCRIPTION π¦
so like, pvalloc() is basically valloc()'s slightly extra sibling. it does the same page-aligned thing, BUT it also rounds size up to the next multiple of the system page size. no half-pages, no crumbs, no "close enough" β it's all the way rounded up, periodt. β¨
π ATTRIBUTES π
for the whole explanation of what these terms even mean, go peek at attributes(7). it's the lore, iykyk π
- Interface:
pvalloc() - Attribute: Thread safety
- Value: MT-Unsafe init π
so yeah, the thread safety vibe check says MT-Unsafe init β don't be out here calling it all willy-nilly from threads during init, bestie. π
π STANDARDS π
GNU. that's it, that's the standard. slay, GNU. π
β HISTORY β
glibc 2.0. an elder. a legend. a true original π«‘β¨
π CAVEATS π
honestly just go read valloc(3). same energy, same warnings, we're not retyping the whole thing. π
π₯ SEE ALSO π₯
valloc(3)β the whole reason this page exists, fr fr
and that's the tea, bestie π this little legend came to us via Linux man-pages 6.20, dated 2025-12-13 β go forth, allocate responsibly, and maybe don't use the deprecated one ππ¦π
π¦ where this page comes from
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- π the page's license: Linux-man-pages-copyleft
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms