SDL_realloc_func(3type)
π SDL_realloc_func β the SDL3 DATATYPES glow-up π
okay bestie, so this one is SDL_realloc_func(3type), living its best life in the SDL3 datatypes family, and it's literally just a callback type. no cap. let's get into it π¦
β¨ NAME β¨
SDL_realloc_func β a callback used to implement SDL_realloc().
like. it's the lil function pointer that SDL_realloc() calls under the hood. it's giving backstage crew energy π
β¨ SYNOPSIS β¨
#include <SDL3/SDL_stdinc.h>
typedef void *(SDLCALL *SDL_realloc_func)(void *mem, size_t size);
yes that's the whole thing. short and iconic, as always π
β¨ DESCRIPTION β¨
SDL will always make sure that the size it passes you is greater than 0. fr fr, you never have to sit there wondering "hmm what if it's zero" β it won't be. that's the entire description, bestie. she's lowkey simple and we respect that πΈ
β¨ FUNCTION PARAMETERS β¨
memβ a pointer to allocated memory you wanna reallocate, orNULL. yep,NULLis totally fine here, it's not a weird vibe at all π«Άsizeβ the new size of the memory. the fresh fit you're putting it in β¨
β¨ RETURN VALUE β¨
Returns a pointer to the newly allocated memory. or NULL if the allocation failed π (and if that happens... it happens. check your pointer, babe.)
β¨ THREAD SAFETY β¨
It should be safe to call this callback from any thread. main character energy across the whole board, no exceptions π§
β¨ AVAILABILITY β¨
This datatype has been available since SDL 3.2.0. so if you're on anything older... girl, upgrade π
β¨ SEE ALSO β¨
SDL_realloc(3)SDL_GetOriginalMemoryFunctions(3)SDL_GetMemoryFunctions(3)SDL_SetMemoryFunctions(3)
go read those too, iykyk π
that's the whole page, bestie!! you ate that. now go realloc something responsibly π
sending you off with love from Simple Directmedia Layer, serving SDL 3.4.18 realness πβ¨
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms