drmm_kzalloc(9)
π drmm_kzalloc β the Kernel API Manual, bestie edition β¨
okay so this is drmm_kzalloc(9) from the Kernel API Manual, and it's genuinely one of the good ones β it's giving "allocated memory that cleans up after itself" energy and honestly? obsessed. π
β¨ NAME β¨
drmm_kzalloc β a &drm_device managed kzalloc() π«Ά
πΈ SYNOPSIS πΈ
void * drmm_kzalloc (struct drm_device *dev , size_t size , gfp_t gfp );
π¦ ARGUMENTS π¦
devβ the DRM device π this is the main character whose lifetime the memory is tied tosizeβ size of the memory allocation, aka how much room you're asking forgfpβ GFP allocation flags, the little settings menu for how the alloc happens
π DESCRIPTION π
Bestie listen. This is a drm_device managed version of kzalloc. The allocated memory is automatically freed on the final drm_dev_put β like, you don't have to manually free it, it just knows. β¨
And if you're impatient (valid), memory can also be freed before the final drm_dev_put by calling drmm_kfree. So you've got options, iykyk π
π SEE ALSO π
Kernel file ./include/drm/drm_managed.h π and its little friend group:
drmm_add_action(9)drmm_add_action_or_reset(9)drmm_kmalloc_array(9)drmm_kcalloc(9)drmm_mutex_init(9)drmm_alloc_ordered_workqueue(9)
ngl the wholedrmm_*family ate and left no crumbs β go read the header, it's right there in./include/drm/drm_managed.hπ
and that's the whole page, bestie!! this one comes to you from ./include/drm (that's the source, mwah π«Ά) and it's dated October 2026 β iconic era, no cap. slay, go free your memory responsibly πβ¨π§
π¦ 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