---
name: "SDL_IOFromDynamicMem"
section: "3"
platform: "linux"
package: "libsdl3-doc"
version: "3.2.10+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_IOFromDynamicMem"
---

# SDL\_IOFromDynamicMem(3)

Use this function to create an SDL\_IOStream that is backed by dynamically allocated memory.

## NAME

SDL\_IOFromDynamicMem - Use this function to create an  **SDL\_IOStream**\
  that is backed by dynamically allocated memory.

## HEADER FILE

Defined in SDL3/SDL\_iostream.h

## SYNOPSIS

```
#include "SDL3/SDL.h"
```

**SDL\_IOStream \* SDL\_IOFromDynamicMem(void);**

## DESCRIPTION

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.

## SEE ALSO

**•**(3), [**SDL\_CloseIO**(3)](/SDL_CloseIO/3.md), **•**(3), [**SDL\_ReadIO**(3)](/SDL_ReadIO/3.md), **•**(3), [**SDL\_SeekIO**(3)](/SDL_SeekIO/3.md), **•**(3), [**SDL\_TellIO**(3)](/SDL_TellIO/3.md), **•**(3), [**SDL\_WriteIO**(3)](/SDL_WriteIO/3.md)
