mirror of
https://github.com/dhewm/dhewm3.git
synced 2024-11-23 04:51:56 +00:00
Assertions in _alloca() and _alloca16() for too big stack allocations
not on Windows though, for some reason MSVC doesn't like my ugly hack to add an assert() to the _alloca16() macro :-/
This commit is contained in:
parent
bcf647cf71
commit
aca8c24c3a
2 changed files with 3 additions and 3 deletions
|
@ -1197,7 +1197,7 @@ void R_ListImages_f( const idCmdArgs &args ) {
|
|||
|
||||
totalSize = 0;
|
||||
|
||||
sortedImage_t *sortedArray = (sortedImage_t *)alloca( sizeof( sortedImage_t ) * globalImages->images.Num() );
|
||||
sortedImage_t *sortedArray = (sortedImage_t *)_alloca( sizeof( sortedImage_t ) * globalImages->images.Num() );
|
||||
|
||||
for ( i = 0 ; i < globalImages->images.Num() ; i++ ) {
|
||||
image = globalImages->images[ i ];
|
||||
|
|
|
@ -136,8 +136,8 @@ If you have questions concerning this license or the applicable additional terms
|
|||
// Unix
|
||||
#ifdef __unix__
|
||||
|
||||
#define _alloca alloca
|
||||
#define _alloca16( x ) ((void *)((((uintptr_t)alloca( (x)+15 )) + 15) & ~15))
|
||||
#define _alloca( x ) (({assert( (x)<600000 );}), alloca( (x) ))
|
||||
#define _alloca16( x ) (({assert( (x)<600000 );}),((void *)((((uintptr_t)alloca( (x)+15 )) + 15) & ~15)))
|
||||
|
||||
#ifdef GAME_DLL
|
||||
#define ID_GAME_API __attribute__((visibility ("default")))
|
||||
|
|
Loading…
Reference in a new issue