al_ustr_free(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ al_ustr_free β€” Allegro 5 API ✨

okay bestie, welcome to al_ustr_free(3alleg5), the page where we say goodbye to a string that has served its purpose 🫢 it's short, it's sweet, it's giving "clean up after yourself" energy, and honestly? iconic.


πŸ’– NAME πŸ’–

al_ustr_free β€” Allegro 5 API

like, that's the whole name. al_ustr_free. it frees a ustr. the vibes are extremely on-the-nose and we love that for us πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <allegro5/allegro.h>

void al_ustr_free(ALLEGRO_USTR *us)

so you're gonna include <allegro5/allegro.h>, and then you call al_ustr_free on a pointer to an ALLEGRO_USTR called us. that's it. that's the whole signature. no return value, no drama, just a void doing its little goodbye wave πŸ‘‹


🌸 DESCRIPTION 🌸

okay so here's the tea: this function frees a previously allocated string. you know that ALLEGRO_USTR you made earlier with all the hopes and dreams and allocated memory? yeah, this is how you release it back into the wild. main character exit, no sequel πŸ’€

and the sweetest part? if the argument is NULL, it does absolutely nothing. no crash, no tantrum, no "bestie why did you do that". it just shrugs and moves on. lowkey the most emotionally mature function in the whole library ngl 🧚

no cap though: this is for strings that were previously allocated. don't be out here freeing random pointers you found on the sidewalk, okay? that's not the vibe, that's undefined behaviour πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹

if you're obsessed with al_ustr_free (and why wouldn't you be), go check out its siblings:

that's the whole found family right there. one of them makes the string, and this one tucks it into bed 🌈


and that's a wrap, bestie πŸ’œ this page lives in the Allegro reference manual, it's the al_ustr_free(3alleg5) entry, and you just ate that whole thing up. periodt. πŸŽ€βœ¨

πŸ“¦ where this page comes from