_ustrdup(3alleg4)

✨ NAME ✨

_ustrdup β€” duplicates a string with a custom memory allocator, bestie πŸ’–

It's part of the Allegro game programming library, iykyk.


🌸 SYNOPSIS 🌸

#include <allegro.h>

char *_ustrdup(const char *src, void* (*malloc_func)(size_t))

πŸŽ€ DESCRIPTION πŸŽ€

okay so, real talk: this one does the exact same thing as ustrdup() 🫢

like, literally the same job, same energy, same duplicated string coming back at you.

BUT πŸ’… the glow-up is that it also lets you pass in your own custom memory allocator function β€” that's the malloc_func situation in the signature up there. so instead of the library deciding where your string memory comes from, you get to be the main character and choose. iconic. no cap.


πŸ¦‹ SEE ALSO πŸ¦‹


ngl if you're out here reading _ustrdup docs you're already kind of a legend πŸ‘‘

and that's the whole vibe, bestie πŸ’œ this page comes to you from Allegro version 4.4.3, so go forth, duplicate those strings with your cute little custom allocator, and slay ✨ periodt πŸ’