dhewm3/neo
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
..
cm Fix/work around other misc. compiler warnings 2023-01-05 09:06:34 +01:00
d3xp Initialize variabls ubsan complained about 2024-03-20 18:32:26 +01:00
framework dhewm3 1.5.3 2024-03-29 01:41:04 +01:00
game Make Sys_SetInteractiveIngameGuiActive() work better 2024-03-17 04:03:27 +01:00
idlib Fix MSVC non-Release builds (_alloca()/assert() didn't play nice) 2023-03-02 18:04:48 +01:00
MayaImport s/LittleLong/LittleInt/ to match the return type 2012-06-28 13:02:47 +02:00
renderer Make it build and work on old PPC Macs again (#568) 2024-03-27 01:04:11 +01:00
sound Make it build and work on old PPC Macs again (#568) 2024-03-27 01:04:11 +01:00
sys Don't use GCC's __builtin_alloca_with_align(), fix #572 2024-04-19 07:24:32 +02:00
tools Fixup: typo: 'hiehgt' -> 'height' in a few places around the codebase 2023-02-04 19:34:29 +01:00
TypeInfo Get rid of Sys_FPU_StackIsEmpty() 2012-07-06 01:06:53 +02:00
ui Fix cursor focus for gamepads, once again, #566 2024-03-20 18:31:28 +01:00
CMakeLists.txt Suppress GCC warnings about variables with C++20 keyword names 2024-03-27 16:15:21 +01:00
config.h.in Introduce CMAKE_INSTALL_PREFIX relative paths 2012-07-04 02:18:42 +02:00
mmakefile.src # move the AROS specific folder icon and default.cfg mmakefile.src under neo/sys/aros/setup 2017-04-22 16:21:14 +02:00