_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 π¦
ustrdup(3alleg4)β the vanilla version of this, no custom allocator shenanigans πuconvert(3alleg4)ustrsize(3alleg4)ustrsizez(3alleg4)
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 π
π¦ where this page comes from
- debian bookworm: allegro4-doc 2:4.4.3.1-3 Β· Allegro-gift-ware
- debian trixie: allegro4-doc 2:4.4.3.1-5 Β· Allegro-gift-ware
- ubuntu jammy: allegro4-doc 2:4.4.3.1-2 Β· Allegro-gift-ware
- ubuntu noble: allegro4-doc 2:4.4.3.1-4.1build3 Β· Allegro-gift-ware
- ubuntu questing: allegro4-doc 2:4.4.3.1-6
- ubuntu resolute: allegro4-doc 2:4.4.3.1-7 Β· Allegro-gift-ware
- ubuntu stonking: allegro4-doc 2:4.4.3.1-9 Β· Allegro-gift-ware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms