logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SDL_ALLOC_SIZE - A macro to tag a function as returning a certain allocation.

Availability

       This macro is available since SDL 3.2.0.

Simple Directmedia Layer                           SDL 3.2.10                                  SDL_ALLOC_SIZE(3)

Description

       This is a hint to the compiler that a function allocates and returns a specific amount of memory based on
       one  of  its  arguments.  For  example,  the  C  runtime's malloc() function could use this macro with an
       argument of 1 (first argument to malloc is the size of the allocation).

       On compilers without alloc_size support, this is defined to nothing.

       Most apps don't need to, and should not, use this directly.

Header File

       Defined in SDL3/SDL_begin_code.h

Name

       SDL_ALLOC_SIZE - A macro to tag a function as returning a certain allocation.

Synopsis

#include"SDL3/SDL.h"#defineSDL_ALLOC_SIZE(p)__attribute__((alloc_size(p)))

See Also