vmalloc_32(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’œ vmalloc_32(9) β€” the Kernel API Manual, bestie edition πŸ’œ

okay so picture this: it's vmalloc_32(9) from the Kernel API Manual, and it's literally the reason your 32-bit-addressable allocations don't fall apart. it's giving "small but mighty" energy and honestly? iconic.


✨ NAME ✨

vmalloc_32 β€” allocate virtually contiguous memory that's 32bit addressable πŸŽ€


🌸 SYNOPSIS 🌸

void * vmalloc_32 (unsigned long size );

like, that's the whole thing. one function, one arg, so clean. periodt. πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • size β€” the allocation size, a.k.a. how much memory you're asking for, bestie. don't lie to it.

🌈 DESCRIPTION 🌈

so what this actually does πŸ‘‘ β€” it allocates enough 32bit PA addressable pages to cover size, and it grabs them from the page level allocator, then maps them into contiguous kernel virtual space. so you get one nice continuous-looking block of virtual memory, but the underlying physical pages are only guaranteed to be reachable with a 32-bit physical address. lowkey the whole point, fr fr. ✨


πŸ’€ RETURN πŸ’€

a pointer to the allocated memory 🫢 β€” or NULL on error, at which point you should be like "😭 okay noted" and check your pointer before you use it.

no cap: if it hands you NULL, that's an error. do not dereference it. do not pass go. do not collect $200. πŸ™ˆ

⭐ SEE ALSO ⭐

the whole fam, iykyk β€” all of this lives in the kernel file ./mm/vmalloc.c:


and that's the page, bestie πŸ§šπŸ’– this one's from the ./mm source, October 2026 release of vmalloc_32(9) β€” go forth and allocate responsibly βœ¨πŸ“πŸ«ΆπŸŒΈ

πŸ“¦ where this page comes from