SDL_AtomicIncRef(3)

🌸 NAME 🌸

SDL_AtomicIncRef - Increment an atomic variable used as a reference count.

okay so this is an SDL3 FUNCTIONS page, and it's giving tiny macro, big atomic energy. πŸ’…


✨ SYNOPSIS ✨

#include <SDL3/SDL_atomic.h>

#define SDL_AtomicIncRef(a)    SDL_AddAtomicInt(a, 1)

πŸ’– DESCRIPTION πŸ’–

Note: If you don't know what this macro is for, you shouldn't use it!

Like literally, bestie β€” if this isn't already your moment, do not force it. πŸ™ˆ This macro is for incrementing an atomic variable that's being used as a reference count, and it does that by expanding to SDL_AddAtomicInt(a, 1). Slay.


πŸŽ€ MACRO PARAMETERS πŸŽ€

  • a β€” a pointer to an SDL_AtomicInt to increment.

⭐ RETURN VALUE ⭐

Returns the previous value of the atomic variable. Not the new one, bestie β€” the previous one. πŸ’…


🧚 THREAD SAFETY 🧚

It is safe to call this macro from any thread. No cap. 🌈


πŸ‘‘ AVAILABILITY πŸ‘‘

This macro is available since SDL 3.2.0. Iconic behavior.


πŸ¦‹ SEE ALSO πŸ¦‹


Simple Directmedia Layer β€’ SDL 3.4.18 β€’ that's the footer, bestie, and this page ate. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from