SDL_IOFromDynamicMem(3)

SDL_IOFromDynamicMem3

Use this function to create an sdl_iostream that is backed by dynamically allocated memory.

Usage

#include "SDL3/SDL.h"

SDL_IOStream * SDL_IOFromDynamicMem(void);

Header file

Defined in SDL3/SDL_iostream.h

Overview

This supports the following properties to provide access to the memory and control over allocations:

• SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER :
a pointer to the internal memory of the stream. This can be set to NULL
to transfer ownership of the memory to the application, which should free
the memory with SDL_free (). If this is done, the next
operation on the stream must be SDL_CloseIO ().

• SDL_PROP_IOSTREAM_DYNAMIC_CHUNKSIZE_NUMBER :
memory will be allocated in multiples of this size, defaulting to 1024.

Return value

( SDL_IOStream
*) Returns a pointer to a new

SDL_IOStream
structure or NULL on failure; call

SDL_GetError () for more information.

Thread safety

It is safe to call this function from any thread.

Availability

This function is available since SDL 3.2.0.

From libsdl3-doc 3.2.10+ds-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.