mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-13 05:16:01 +00:00
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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user