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