dhewm3/neo/sys
Daniel Gibson 6daf1e9e7f Don't use GCC's __builtin_alloca_with_align(), fix #572
turns out that __builtin_alloca_with_align() might releases the
allocated memory at the end of the block it was allocated in, instead
of the end of the function (which is the behavior of regular alloca()
and __builtin_alloca()): "The lifetime of the allocated object ends at
 the end of the block in which the function was called. The allocated
 storage is released no later than just before the calling function
 returns to its caller, but may be released at the end of the block in
 which the function was called."
https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html#index-_005f_005fbuiltin_005falloca_005fwith_005falign

Clang also supports __builtin_alloca_with_align(), but always releases
the memory at the end of the function.

And it seems that newer GCC versions also tend to release it at the
end of the function, but GCC 4.7.2 (that I use for the official Linux
release binaries) didn't, and that caused weird graphical glitches.
But as I don't want to rely on newer GCC versions behaving like this
(and the documentation explicitly says that it *may* be released at
 the end of the block, but will definitely be released at the end of
 the function), I removed all usage of __builtin_alloca_with_align().

(Side-Note: GCC only started documenting the behavior of
 __builtin_alloca and __builtin_alloca_with_align at all with GCC 6.1.0)
2024-04-19 07:24:32 +02:00
..
aros dhewm3log.txt for AROS 2022-01-16 06:12:51 +01:00
cmake Use stb_vorbis instead of libogg and libvorbis(file) 2021-04-27 20:08:59 +02:00
linux POSIX: log output to save_path/dhewm3log.txt 2022-01-16 06:11:20 +01:00
osx Make it build and work on old PPC Macs again (#568) 2024-03-27 01:04:11 +01:00
posix POSIX: log output to save_path/dhewm3log.txt 2022-01-16 06:11:20 +01:00
stub Make window alpha chan opaque on Wayland, fix #426 2022-02-05 16:34:34 +01:00
win32 Fixup: typo: 'hiehgt' -> 'height' in a few places around the codebase 2023-02-04 19:34:29 +01:00
cpu.cpp Fix sys/cpu.cpp for msvc 64bit 2012-07-06 01:06:59 +02:00
doom_icon.h Window Icon, make in_nograb work with SDL2 2015-03-02 00:03:30 +01:00
events.cpp Make Sys_SetInteractiveIngameGuiActive() work better 2024-03-17 04:03:27 +01:00
glimp.cpp Make window alpha chan opaque on Wayland, fix #426 2022-02-05 16:34:34 +01:00
platform.h Don't use GCC's __builtin_alloca_with_align(), fix #572 2024-04-19 07:24:32 +02:00
sys_local.cpp Get rid of Sys_FPU_StackIsEmpty() 2012-07-06 01:06:53 +02:00
sys_local.h Get rid of Sys_FPU_StackIsEmpty() 2012-07-06 01:06:53 +02:00
sys_public.h Make Sys_SetInteractiveIngameGuiActive() work better 2024-03-17 04:03:27 +01:00
threads.cpp Fix SDL1.2 build and type of xthreadInfo::threadId 2023-01-16 03:22:01 +01:00