SDL_GETORIGINALMEMORYFUNCTIONS(3)

πŸ’– SDL_GetOriginalMemoryFunctions(3) πŸ’–

okay bestie, welcome to the SDL3 functions corner of the manual, this one's called SDL_GetOriginalMemoryFunctions and it's giving "where did all the memory go" in the best way possible 🧚✨


✨ NAME ✨

SDL_GetOriginalMemoryFunctions β€” grab the original set of SDL memory functions πŸŽ€


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_stdinc.h>

void SDL_GetOriginalMemoryFunctions(SDL_malloc_func *malloc_func,
                                SDL_calloc_func *calloc_func,
                                SDL_realloc_func *realloc_func,
                                SDL_free_func *free_func);

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea, bestie β˜• this is what SDL_malloc and friends will use by default, as long as nobody has called SDL_SetMemoryFunctions. no cap.

and now for the plot twist πŸ‘€ this is not necessarily using the C runtime's malloc functions behind the scenes! Different platforms and build configurations might do any number of unexpected things. literally anything. so do not assume, okay? πŸ™ˆ


πŸ’… FUNCTION PARAMETERS πŸ’…

  • malloc_func β€” gets filled with the malloc function ✨
  • calloc_func β€” gets filled with the calloc function ✨
  • realloc_func β€” gets filled with the realloc function ✨
  • free_func β€” gets filled with the free function ✨

πŸ”₯ THREAD SAFETY πŸ”₯

good news queen πŸ‘‘ it is safe to call this function from any thread. go off, thread it, no notes πŸ’œ


⭐ AVAILABILITY ⭐

this function is available since SDL 3.2.0 🌈


and that's the whole page, you ate it, periodt πŸ’…βœ¨

from the Simple Directmedia Layer era, SDL 3.4.18 edition β€” SDL_GetOriginalMemoryFunctions(3), mwah πŸ«ΆπŸ’–

πŸ“¦ where this page comes from