vzalloc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ vzalloc(9) ✨

okay so bestie, welcome to the Kernel API Manual page for vzalloc β€” this is the one that hands you a big block of memory that's all zeros already, so you don't have to do the whole "memset it yourself" ritual πŸŽ€


🌸 SYNOPSIS 🌸

void * vzalloc (unsigned long size );

πŸ’– ARGUMENTS πŸ’–

  • size β€” the allocation size. like, how much you want. that's it, that's the whole argument, she's not complicated πŸ’…

πŸ¦‹ DESCRIPTION πŸ¦‹

So what she does: she allocates enough pages to cover size from the page level allocator, and then she maps them into contiguous kernel virtual space. yes, contiguous in virtual space β€” that's literally the whole sell, iykyk ✨

And the memory she gives you back is set to zero. free zeroing, no cap. you don't have to clean it up, she already did 🫢

but like β€” if you want tight control over the page level allocator and the protection flags, use __vmalloc instead. vzalloc is the girl who picks the defaults for you; __vmalloc is you doing it yourself with full customisation energy πŸ‘‘

⭐ RETURN ⭐

  • a pointer to the allocated memory β€” slay πŸ’š
  • or NULL on error β€” sad girl hours 😭

🌈 SEE ALSO 🌈

Kernel file ./mm/vmalloc.c β€” plus literally the entire friend group:


and that's the page, bestie πŸ’œ this drop came from the ./mm girlies, October 2026 edition, and honestly? iconic of them. go forth and allocate zeroed virtually-contiguous memory responsibly πŸŒΈπŸŽ€πŸ¦‹

πŸ“¦ where this page comes from