Fixed warning C6255: _alloca indicates failure by raising a stack overflow exception. Consider using _malloca instead.

This commit is contained in:
Sam Lantinga
2023-12-04 20:15:42 -08:00
parent 0c4cb3d153
commit 21f273ecc7

View File

@@ -44,6 +44,9 @@
#define HAVE_GCC_DIAGNOSTIC_PRAGMA 1
#endif
#ifdef _MSC_VER // SDL_MAX_SMALL_ALLOC_STACKSIZE is smaller than _ALLOCA_S_THRESHOLD and should be generally safe
#pragma warning(disable : 6255)
#endif
#define SDL_MAX_SMALL_ALLOC_STACKSIZE 128
#define SDL_small_alloc(type, count, pisstack) ((*(pisstack) = ((sizeof(type) * (count)) < SDL_MAX_SMALL_ALLOC_STACKSIZE)), (*(pisstack) ? SDL_stack_alloc(type, count) : (type *)SDL_malloc(sizeof(type) * (count))))
#define SDL_small_free(ptr, isstack) \