SDL_IOFromDynamicMem(3)
π SDL_IOFromDynamicMem(3) π
okay so bestie, welcome to the SDL3 FUNCTIONS corner of the manual, and today's main character is SDL_IOFromDynamicMem β¨
πΈ NAME πΈ
SDL_IOFromDynamicMem β use this function to make an SDL_IOStream that's backed by dynamically allocated memory. that's it, that's the whole vibe π«Ά
β¨ SYNOPSIS β¨
#include <SDL3/SDL_iostream.h>
SDL_IOStream * SDL_IOFromDynamicMem(void);
no arguments, no drama, just vibes π
π¦ DESCRIPTION π¦
so like, this stream is lowkey self-growing: it supports the following properties so you can get at the memory and also control how allocations happen π
SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTERβ a pointer to the internal memory of the stream. you can set this toNULLto transfer ownership of the memory to the application, and then the application should free that memory withSDL_free(). and here's the part you cannot skip, bestie: if you do this, the next operation on the stream must beSDL_CloseIO(). no cap, that's the rule πSDL_PROP_IOSTREAM_DYNAMIC_CHUNKSIZE_NUMBERβ memory gets allocated in multiples of this size, and it defaults to1024. cute, right? π
π RETURN VALUE π
returns a pointer to a shiny new SDL_IOStream structure, or NULL if it fails π. if it fails, call SDL_GetError() for more info, she'll tell you what went wrong π«Ά
π THREAD SAFETY π
it is safe to call this function from any thread. go off, multithreaded queen π
π AVAILABILITY π
this function has been available since SDL 3.2.0 β
π SEE ALSO π
okay that's the whole page, mwah π this was brought to you by Simple Directmedia Layer, version SDL 3.4.18 β she ate and left no crumbs, periodt π β¨π
π¦ 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