SDL_memmove(3)

πŸ’– SDL_memmove(3) πŸ’–

okay bestie, we're in the SDL3 FUNCTIONS section of the manual and this one is a genuine little icon, no cap ✨


🌸 NAME 🌸

SDL_memmove β€” copy memory ranges that might overlap 🫢


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_stdinc.h>

void * SDL_memmove(void *dst, const void *src, size_t len);

πŸ¦‹ DESCRIPTION πŸ¦‹

so like, the whole vibe here is that it is totally okay for the memory regions to overlap. that's the point. that's the assignment. she handles it πŸ’…

but listen β€” if you are confident that the regions never overlap, then using SDL_memcpy() may improve performance. so it's giving "know your data, choose your fighter" ✨


🌈 FUNCTION PARAMETERS 🌈

  • dst β€” the destination memory region. Must not be NULL. like fr fr, do not do that to her 😭
  • src β€” the source memory region. Must not be NULL. same energy, bestie πŸ™ˆ
  • len β€” the length in bytes of both dst and src. one number, two regions, that's the deal πŸ’«

πŸ‘‘ RETURN VALUE πŸ‘‘

returns dst. that's it. she gives you back your destination pointer, main character behavior πŸ’…


🧚 THREAD SAFETY 🧚

it is safe to call this function from any thread. go off, multi-threaded queen πŸ”₯


⭐ AVAILABILITY ⭐

this function is available since SDL 3.2.0. so if you're on something older, that's a no from her πŸŽ€


πŸ’œ SEE ALSO πŸ’œ


quick reminder bestie: overlapping regions = SDL_memmove. non-overlapping regions = maybe SDL_memcpy() for the speed. pick accordingly, iykyk πŸ¦‹

k bye, this page came to you from the fine folks at Simple Directmedia Layer, running SDL 3.4.18, and it's the SDL_memmove(3) page itself. mwah πŸ’–βœ¨

πŸ“¦ where this page comes from