SDL_zerop(3)
π NAME π
SDL_zerop β bestie, this one wipes an object's memory clean to zero, and it does it through a pointer. π
β¨ SYNOPSIS β¨
#include <SDL3/SDL_stdinc.h>
#define SDL_zerop(x) SDL_memset((x), 0, sizeof(*(x)))
π«Ά DESCRIPTION π«Ά
Okay so picture this: this macro is literally just a glow-up wrapper over SDL_memset, except it does the annoying part for you and calculates the object size all by itself. Which means no copy/paste disasters, no sneaky typos that haunt you at 3am, and honestly the code just looks cleaner. β¨ It's giving "I have my life together."
But listen, bestie β important: this needs a pointer to an object. Not the object itself, and not an array. The vibes have to be exactly right or it's not gonna work.
πΈ MACRO PARAMETERS πΈ
xβ a pointer to the object you wanna clear. That's it, that's the whole job. π§
π¦ THREAD SAFETY π¦
It is safe to call this macro from any thread. Go wild, no drama, no fighting over it. π
β AVAILABILITY β
This macro has been available since SDL 3.2.0. She's been iconic for a while now. π
π SEE ALSO π
Okay that's the whole page, ily, go forth and zero out your memory responsibly. π
Signed, sealed, delivered by Simple Directmedia Layer, version SDL 3.4.18 β SDL_zerop(3), no cap. πβ¨
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms