drmm_kmalloc_array(9)
β¨ drmm_kmalloc_array(9) β¨
okay bestie, welcome to the Kernel API Manual β this is the page for drmm_kmalloc_array, and yes it's a whole mood π
πΈ NAME πΈ
drmm_kmalloc_array β the &drm_device managed version of kmalloc_array(), no cap π«Ά
π SYNOPSIS π
void * drmm_kmalloc_array (struct drm_device *dev , size_t n , size_t
size , gfp_t flags );
literally that's the whole vibe, look at her go β¨
π¦ ARGUMENTS π¦
devβ the DRM device, she's the main character here πnβ number of array elements to allocate, like how many lil slots you want πsizeβ size of one array member, i.e. how chunky each slot isflagsβ the GFP allocation flags, you know the drill π«
π DESCRIPTION π
so this is a drm_device managed version of kmalloc_array β think of it as kmalloc_array but with a built-in cleanup crew π§
the way that this works: the memory you allocate is automatically freed on the final drm_dev_put. you don't have to remember to free it, she handles it herself, iconic behaviour honestly π
and it works exactly like a memory allocation obtained by drmm_kmalloc β same energy, same rules, periodt π₯
π SEE ALSO π
kernel file ./include/drm/drm_managed.h, plus the whole friend group:
drmm_add_action(9)drmm_add_action_or_reset(9)drmm_kzalloc(9)drmm_kcalloc(9)drmm_mutex_init(9)drmm_alloc_ordered_workqueue(9)
π small reminder: this page lives in./include/drm, dated October 2026, and it's all thedrmm_kmalloc_array(9)manual page β go forth and allocate responsibly, bestie π
β mwah, that's the page β
π¦ 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