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_CompilerBarrier - Mark a compiler barrier.

Availability

       This macro is available since SDL 3.2.0.

Simple Directmedia Layer                           SDL 3.2.10                             SDL_CompilerBarrier(3)

Description

       A  compiler  barrier prevents the compiler from reordering reads and writes to globally visible variables
       across the call.

       This macro only prevents the compiler from reordering reads and writes, it does not prevent the CPU  from
       reordering  reads  and  writes.  However, all of the atomic operations that modify memory are full memory
       barriers.

Header File

       Defined in SDL3/SDL_atomic.h

Name

       SDL_CompilerBarrier - Mark a compiler barrier.

Synopsis

#include"SDL3/SDL.h"#defineSDL_CompilerBarrier()DoCompilerSpecificReadWriteBarrier()

Thread Safety

       Obviously this macro is safe to use from any thread at any time, but if you find yourself  needing  this,
       you are probably dealing with some very sensitive code; be careful!

See Also