mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-03-02 23:18:44 +00:00
Be more lenient about stack memory
The new stack size is 256kb in order to compromise with llama.cpp's aggressive use of stack memory, which can't be easily patched. This change disables the dynamic alloca() and VLA warnings for now, plus frame sizes for individual functions may be <=50% of the stack size This only applies to code in the cosmo monorepo. Open source builds should already be using an 8mb stack by default, like everyone else
This commit is contained in:
parent
fec139f423
commit
f42089d5c6
2 changed files with 4 additions and 6 deletions
|
@ -756,10 +756,10 @@ typedef struct {
|
|||
#if __GNUC__ >= 6
|
||||
#pragma GCC diagnostic error "-Wnonnull-compare"
|
||||
#if defined(COSMO) && !defined(MODE_DBG) && !defined(STACK_FRAME_UNLIMITED)
|
||||
#pragma GCC diagnostic error "-Wframe-larger-than=16384"
|
||||
#pragma GCC diagnostic error "-Wframe-larger-than=131072"
|
||||
#if __GNUC__ >= 9
|
||||
#pragma GCC diagnostic error "-Walloca-larger-than=1024"
|
||||
#pragma GCC diagnostic error "-Wvla-larger-than=1024"
|
||||
// #pragma GCC diagnostic error "-Walloca-larger-than=1024"
|
||||
// #pragma GCC diagnostic error "-Wvla-larger-than=1024"
|
||||
#endif /* GCC 9+ */
|
||||
#endif /* STACK_FRAME_UNLIMITED */
|
||||
#elif __GNUC__ >= 9
|
||||
|
|
|
@ -67,10 +67,8 @@
|
|||
#endif
|
||||
|
||||
/* TODO(jart): Remove this in favor of GetStackSize() */
|
||||
#if defined(COSMO) && (defined(MODE_DBG) || defined(__SANITIZE_ADDRESS__))
|
||||
#ifdef COSMO
|
||||
#define STACKSIZE 262144 /* 256kb stack */
|
||||
#elif defined(COSMO)
|
||||
#define STACKSIZE 131072 /* 128kb stack */
|
||||
#else
|
||||
#define STACKSIZE 8388608 /* 8mb stack */
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue