Replaced SDL_SIMDAlloc(), SDL_SIMDRealloc(), and SDL_SIMDFree() with SDL_aligned_alloc() and SDL_aligned_free()

Fixes https://github.com/libsdl-org/SDL/issues/5641
This commit is contained in:
Sam Lantinga
2023-01-09 17:42:16 -08:00
parent 9597c482fa
commit 2aa9569b3e
13 changed files with 132 additions and 194 deletions

View File

@@ -165,7 +165,7 @@ SDL_CreateSurface(int width, int height, Uint32 format)
}
}
surface->pixels = SDL_SIMDAlloc(size);
surface->pixels = SDL_aligned_alloc(SDL_SIMDGetAlignment(), size);
if (!surface->pixels) {
SDL_DestroySurface(surface);
SDL_OutOfMemory();
@@ -1553,7 +1553,7 @@ void SDL_DestroySurface(SDL_Surface *surface)
/* Don't free */
} else if (surface->flags & SDL_SIMD_ALIGNED) {
/* Free aligned */
SDL_SIMDFree(surface->pixels);
SDL_aligned_free(surface->pixels);
} else {
/* Normal */
SDL_free(surface->pixels);