SDL_malloc
alignment properties unspecified in documentation
#11961
Milestone
SDL_malloc
alignment properties unspecified in documentation
#11961
SDL3's documentation does not specify a minimum alignment of
SDL_malloc
, implying it could return data with no guaranteed alignment, meaning there's many cases like SDL_ConvertAudioSamples where the returned pointer by SDL cannot be trivially casted to a it's true data type (eg. if im telling SDL to resample tof32
audio, I cannot safely cast theu8*
(natural alignment 1) pointer SDL gives me to anf32*
(natural alignment 4), which seems like an oversight).If
SDL_malloc
should always return at least some minimum of alignment for its data, this should be documented, else, places likeSDL_ConvertAudioSamples
should be changed to allocate aligned memory themselves.The text was updated successfully, but these errors were encountered: