kmalloc_array(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– kmalloc_array(9) β€” kernel API manual, bestie edition πŸ’–

Okay so real talk: this is the kernel API manual page for kmalloc_array, and it's genuinely one of the most useful little guys in the whole slab family. Buckle up πŸŽ€

✨ NAME ✨

kmalloc_array β€” allocate memory for an array. That's it, that's the whole vibe. It grabs you a chunk of memory sized for n things of size bytes each. Slay. πŸ’…

🌸 SYNOPSIS 🌸

void * kmalloc_array (size_t n , size_t size , gfp_t flags );

Look at her. Three args, returns a void *, no drama. πŸ¦‹

🧚 ARGUMENTS 🧚

  • n β€” number of elements. Like, how many of the thing do you want? Count them. No cap. ⭐
  • size β€” element size. How big is one of those things? That's this one. πŸ“
  • flags β€” the type of memory to allocate (see kmalloc). Yes bestie, it's giving "go read the kmalloc page for the actual flag list" β€” this one's just pointing you there, iykyk. πŸ‘‘
Heads up: flags is documented by reference to kmalloc, so if you need the actual flag names and semantics, that's where you go. Don't @ me, @ kmalloc. 😭

πŸ’œ SEE ALSO πŸ’œ

Everything in the extended slab cinematic universe, fr fr. And the kernel file it lives in: ./include/linux/slab.h. 🌈


And that's the whole page, bestie β€” go allocate something iconic. πŸ’–βœ¨πŸŽ€πŸ«ΆπŸ”₯

Signed off from ./include/linux, dated October 2026 β€” the source/version and date line, but make it cute. πŸ’œπŸ§šβ€β™€οΈ

πŸ“¦ where this page comes from