free_pages_exact(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– free_pages_exact(9) πŸ’–

okay bestie, welcome to the kernel API manual β€” this one's free_pages_exact(9) and it's literally the cleanup queen πŸ‘‘. she's the counterpart to alloc_pages_exact(), and honestly? every main character needs their other half. 🫢


✨ NAME ✨

free_pages_exact β€” release memory allocated via alloc_pages_exact()

like, it's the undo button. the "nvm take it back" of the page allocator. πŸŽ€


🌸 SYNOPSIS 🌸

void free_pages_exact (void *virt , size_t size );

no cap, that's the whole signature. two args, zero drama (okay maybe a little drama, it's kernel memory). πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • virt β€” the value returned by alloc_pages_exact. like, the exact same pointer you got handed back. don't be out here freelancing with a different one πŸ™ˆ
  • size β€” size of allocation, same value as passed to alloc_pages_exact. the same value, bestie. matching set. periodt. ✨

🧚 DESCRIPTION 🧚

Release the memory allocated by a previous call to alloc_pages_exact.

that's it, that's the vibe. you allocated it, now you're giving it back β€” a full circle moment. it's giving responsible memory management, it's giving no leaks, it's giving icon behavior. 🌈

lowkey important: this frees what alloc_pages_exact() handed you β€” so pair them up properly, iykyk. πŸ’œ

πŸ”₯ SEE ALSO πŸ”₯

the whole friend group, in Kernel file ./mm/page_alloc.c:

like, it's a whole roster. mingle, bestie. πŸ“


and that's the page!! πŸŽ€ dropped from ./mm, dated October 2026, signed free_pages_exact(9) β€” mwah, go free some pages responsibly, love u πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from