kmalloc_array(9)
π 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 (seekmalloc). Yes bestie, it's giving "go read thekmallocpage for the actual flag list" β this one's just pointing you there, iykyk. π
Heads up:flagsis documented by reference tokmalloc, 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. π
SLAB_HWCACHE_ALIGN(9)SLAB_TYPESAFE_BY_RCU(9)SLAB_ACCOUNT(9)SLAB_RECLAIM_ACCOUNT(9)struct kmem_cache_args(9)kmem_cache_create_usercopy(9)kmem_cache_create(9)krealloc_node_align(9)kmem_cache_alloc(9)kmem_cache_charge(9)kmalloc(9)kmalloc_nolock(9)__alloc_objs(9)__alloc_flex(9)kmalloc_obj(9)kmalloc_objs(9)kmalloc_flex(9)krealloc_array(9)kcalloc(9)kzalloc(9)kvmalloc_node(9)kvrealloc_node_align(9)kmalloc_size_roundup(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms