SDL_GetSystemPageSize(3)

πŸ“¦
version 3.4.18 Β· 5 versions
, in fedora 43, fedora 44

✨ SDL_GetSystemPageSize ✨

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where today's main character is SDL_GetSystemPageSize β€” she reports the size of a page of memory. that's it. that's the job. πŸ’…


🌸 NAME 🌸

SDL_GetSystemPageSize β€” report the size of a page of memory.


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_cpuinfo.h>

int SDL_GetSystemPageSize(void);

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea: different platforms might have different memory page sizes. like, in current times, 4 kilobytes is not unusual, but newer systems are moving to larger page sizes, and esoteric platforms might have any unexpected size. no cap, it's a whole spectrum out here. 😭

big important note: this function can return 0, which means SDL can't determine the page size on this platform. and it will not set an error string to be retrieved with SDL_GetError() in this case! fr fr, don't go calling SDL_GetError() and expecting a lil message, because there isn't one. πŸ™ˆ

in that case, defaulting to 4096 is often a reasonable option. noted, bestie. ✨


πŸ’– RETURN VALUE πŸ’–

returns the size of a single page of memory, in bytes, or 0 if SDL can't determine this information. πŸ‘‘


🌈 THREAD SAFETY 🌈

it is safe to call this function from any thread. go off, multithreaded queen. 🫢


⭐ AVAILABILITY ⭐

this function is available since SDL 3.4.0. she's been here a minute. iconic.


Simple Directmedia Layer πŸŽ€ SDL 3.4.18 β€” that's the source and the version, mwah, and SDL_GetSystemPageSize(3) is the page you're reading. bye bestie, go check your page size πŸ’–πŸ§šβ€β™€οΈ

πŸ“¦ where this page comes from