kmalloc_objs(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– kmalloc_objs(9) β€” Kernel API Manual πŸ’–

okay so bestie, welcome to the kmalloc_objs(9) page β€” it’s giving β€œallocate me an array of a type” energy, and honestly? iconic. πŸŽ€


✨ NAME ✨

kmalloc_objs β€” Allocate an array of the given type

like literally, it grabs you an array of whatever type you asked for. no cap. πŸ’…


🌸 SYNOPSIS 🌸

kmalloc_objs (VAR_OR_TYPE , COUNT , ... );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • VAR_OR_TYPE β€” Variable or type to allocate an array of. yes bestie, that’s the whole vibe: tell it what kind of array you want. ✨
  • COUNT β€” How many elements in the array. how many little guys are we fitting in here? πŸ”₯
  • ... β€” optional GFP flags for the allocation (GFP_KERNEL when not specified). so if you don’t pass anything, it defaults to GFP_KERNEL β€” periodt. 🌈

πŸ‘‘ RETURN πŸ‘‘

newly allocated pointer to array of VAR_OR_TYPE on success, or NULL on failure.

so on the good path you get a shiny new pointer to your array, and on the bad path you get NULL β€” not me being dramatic, that’s literally the contract. πŸ˜­πŸ’€


🫢 SEE ALSO 🫢

Kernel file ./include/linux/slab.h

like yes, that’s a lot of friends, but they’re all linked in the kernel lore and you should lowkey go read them if you need the full picture. iykyk πŸ’œ


okay bye bestie β€” this page came from source/version ./include/linux, dated October 2026, and it ate. mwah πŸ’‹πŸŽ€

πŸ“¦ where this page comes from