assoc_array...t_set_object(9)
β¨ assoc_array_insert_set_object β the kernel API manual, bestie edition β¨
okay so real talk, this one's from the Kernel API Manual (section 9, the kernel dev girlies know π ), and it's genuinely a tiny little function that does one very specific thing. Let's get into it π
πΈ NAME πΈ
assoc_array_insert_set_object β literally just "set the new object pointer in an edit script." That's the whole job. Iconic minimalism, no notes.
π¦ SYNOPSIS π¦
void assoc_array_insert_set_object(struct assoc_array_edit *edit, void *object);
Two args, returns nothing. Lowkey the easiest signature you'll see all day π
π ARGUMENTS π
editβ the edit script you're modifying. This is the thing getting poked at.objectβ the object pointer you wanna set. Slap it in there β¨
π DESCRIPTION π
So here's the vibe: you call this to change the object that's gonna be inserted by an edit script. That's it, that's the function π«Ά
Now the important part, and I need you to hear me on this one: the object pointed to by the old object is not freed. Not. Freed. Nobody's cleaning that up for you, bestie. So if you cared about it, that's on you, no cap π
And this has to be done prior to applying the script. Before. Not after, not during, not "ehh roughly around then." Before. Periodt π
π SEE ALSO π
Kernel file ./lib/assoc_array.c, plus the whole assoc_array friend group:
assoc_array_iterate(9)assoc_array_find(9)assoc_array_destroy(9)assoc_array_insert(9)assoc_array_delete(9)assoc_array_clear(9)assoc_array_apply_edit(9)assoc_array_cancel_edit(9)assoc_array_gc(9)
β οΈ reminder from your girl: old object = not freed, and set it before you apply the script. That's the whole trap, don't fall in it π
okay bye, this page lives in ./lib and it's dated October 2026 β signed, sealed, and delivered with love πππ§
π¦ 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