closure_retu...h_destructor(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’« closure_return_with_destructor(9) πŸ’«

okay so this is a page straight out of the Kernel API Manual bestie, and we're talking about a closure finisher with a lil cleanup era attached. stay with me 🫢


✨ NAME ✨

closure_return_with_destructor β€” finish execution of a closure, with destructor πŸ’…


🌸 SYNOPSIS 🌸

closure_return_with_destructor (_cl , _destructor );

πŸŽ€ ARGUMENTS πŸŽ€

  • _cl β€” ngl the original literally just says -- undescribed -- 😭 so that's all we got, no cap
  • _destructor β€” also -- undescribed -- πŸ™ˆ the docs said "not today" and honestly? iconic of them

πŸ¦‹ DESCRIPTION πŸ¦‹

So it works exactly like closure_return ✨ β€” same vibe, same job β€” except that destructor gets called when all outstanding refs on cl have been dropped. 🫢

What's the destructor even for? It may be used to safely free the memory occupied by cl 🧚 and here's the part that matters, so lock in πŸ‘‘

destructor is called with the ref on the parent closure still held β€” so destructor could safely return an item to a freelist protected by cl's parent. πŸ’–

like, the parent ref is still yours when the destructor runs, that's the whole point, don't sleep on it 😀


πŸ’œ SEE ALSO πŸ’œ

Kernel file ./include/linux/closure.h β€”

go read them, they're all fr fr part of the same closure cinematic universe 🌈


mwah πŸ’‹ this page lives in ./include/linux, dated October 2026, and it's titled closure_retu...h_destructor(9) β€” yes the title is truncated with the lil ... and yes we're keeping it exactly like that, slay πŸŽ€βœ¨

πŸ“¦ where this page comes from