mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-06 03:08:31 +00:00
Increase stack size to 128k and guard size to 16k
This improves our compatibility with Apple M1.
This commit is contained in:
parent
57c0dcdc29
commit
dd04aeba1c
36 changed files with 109 additions and 125 deletions
4
third_party/dlmalloc/init.inc
vendored
4
third_party/dlmalloc/init.inc
vendored
|
@ -24,8 +24,8 @@ int init_mparams(void) {
|
|||
size_t gsize;
|
||||
|
||||
#if defined(__COSMOPOLITAN__)
|
||||
psize = 4096;
|
||||
gsize = 65536;
|
||||
psize = FRAMESIZE;
|
||||
gsize = FRAMESIZE;
|
||||
#elif !defined(WIN32)
|
||||
psize = malloc_getpagesize;
|
||||
gsize = ((DEFAULT_GRANULARITY != 0)? DEFAULT_GRANULARITY : psize);
|
||||
|
|
4
third_party/lua/lua.mk
vendored
4
third_party/lua/lua.mk
vendored
|
@ -155,10 +155,6 @@ o/$(MODE)/third_party/lua/lvm.o: private \
|
|||
OVERRIDE_CFLAGS += \
|
||||
-fno-gcse
|
||||
|
||||
o/$(MODE)/third_party/lua/lauxlib.o: private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
-DSTACK_FRAME_UNLIMITED
|
||||
|
||||
$(THIRD_PARTY_LUA_A_OBJS): private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
-ffunction-sections \
|
||||
|
|
4
third_party/lua/luaencodejsondata.c
vendored
4
third_party/lua/luaencodejsondata.c
vendored
|
@ -22,8 +22,8 @@
|
|||
#include "libc/intrin/likely.h"
|
||||
#include "libc/log/log.h"
|
||||
#include "libc/log/rop.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/mem/gc.internal.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/runtime/stack.h"
|
||||
#include "libc/stdio/append.h"
|
||||
#include "libc/stdio/strlist.internal.h"
|
||||
|
@ -169,7 +169,7 @@ static int SerializeTable(lua_State *L, char **buf, int idx,
|
|||
bool multi;
|
||||
bool isarray;
|
||||
lua_Unsigned n;
|
||||
if (UNLIKELY(!HaveStackMemory(PAGESIZE))) {
|
||||
if (UNLIKELY(!HaveStackMemory(GUARDSIZE))) {
|
||||
z->reason = "out of stack";
|
||||
return -1;
|
||||
}
|
||||
|
|
2
third_party/lua/luaencodeluadata.c
vendored
2
third_party/lua/luaencodeluadata.c
vendored
|
@ -353,7 +353,7 @@ static int SerializeTable(lua_State *L, char **buf, int idx,
|
|||
int rc;
|
||||
bool multi;
|
||||
intptr_t rsp, bot;
|
||||
if (UNLIKELY(!HaveStackMemory(PAGESIZE))) {
|
||||
if (UNLIKELY(!HaveStackMemory(GUARDSIZE))) {
|
||||
z->reason = "out of stack";
|
||||
return -1;
|
||||
}
|
||||
|
|
2
third_party/make/make.mk
vendored
2
third_party/make/make.mk
vendored
|
@ -171,8 +171,8 @@ o/$(MODE)/third_party/make/hash.o: private \
|
|||
$(THIRD_PARTY_MAKE_OBJS): private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
-DNO_ARCHIVES \
|
||||
-DSTACK_FRAME_UNLIMITED \
|
||||
-DHAVE_CONFIG_H \
|
||||
-DSTACK_FRAME_UNLIMITED \
|
||||
-DINCLUDEDIR=\".\" \
|
||||
-DLIBDIR=\".\" \
|
||||
-DLOCALEDIR=\".\"
|
||||
|
|
4
third_party/mbedtls/test/test.mk
vendored
4
third_party/mbedtls/test/test.mk
vendored
|
@ -134,10 +134,6 @@ o/$(MODE)/third_party/mbedtls/test/%.com.dbg: \
|
|||
o/$(MODE)/third_party/mbedtls/test/%.com.runs: o/$(MODE)/third_party/mbedtls/test/%.com
|
||||
@$(COMPILE) -ACHECK -wtT$@ $< $(TESTARGS)
|
||||
|
||||
$(THIRD_PARTY_MBEDTLS_TEST_OBJS): private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
-DSTACK_FRAME_UNLIMITED
|
||||
|
||||
o/$(MODE)/third_party/mbedtls/test/lib.o: private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
-fdata-sections \
|
||||
|
|
4
third_party/quickjs/quickjs.mk
vendored
4
third_party/quickjs/quickjs.mk
vendored
|
@ -199,10 +199,6 @@ o/tiny/third_party/quickjs/call.o: private \
|
|||
OVERRIDE_CFLAGS += \
|
||||
-O2
|
||||
|
||||
o/$(MODE)/third_party/quickjs/unicode_gen.o: private \
|
||||
OVERRIDE_CPPFLAGS += \
|
||||
-DSTACK_FRAME_UNLIMITED
|
||||
|
||||
# TODO(jart): Replace alloca() calls with malloc().
|
||||
o/$(MODE)/third_party/quickjs/libregexp.o \
|
||||
o/$(MODE)/third_party/quickjs/quickjs.o: private \
|
||||
|
|
2
third_party/quickjs/unicode_gen.c
vendored
2
third_party/quickjs/unicode_gen.c
vendored
|
@ -22,11 +22,11 @@
|
|||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
#include "libc/mem/alg.h"
|
||||
#include "libc/assert.h"
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/log/log.h"
|
||||
#include "libc/mem/alg.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
|
|
2
third_party/stb/stb.mk
vendored
2
third_party/stb/stb.mk
vendored
|
@ -60,7 +60,7 @@ $(THIRD_PARTY_STB_A_OBJS): private \
|
|||
-ffunction-sections \
|
||||
-fdata-sections
|
||||
|
||||
$(THIRD_PARTY_STB_A_OBJS): private \
|
||||
o/$(MODE)/third_party/stb/stb_vorbis.o: private \
|
||||
OVERRIDE_CPPFLAGS += \
|
||||
-DSTACK_FRAME_UNLIMITED
|
||||
|
||||
|
|
7
third_party/zip/zip.mk
vendored
7
third_party/zip/zip.mk
vendored
|
@ -162,13 +162,6 @@ o/$(MODE)/third_party/zip/zipup.o: private \
|
|||
-DZIP64_SUPPORT \
|
||||
-DBZIP2_SUPPORT
|
||||
|
||||
o/$(MODE)/third_party/zip/zip.o \
|
||||
o/$(MODE)/third_party/zip/zipsplit.o \
|
||||
o/$(MODE)/third_party/zip/fileio.o \
|
||||
o/$(MODE)/third_party/zip/fileio_.o: private \
|
||||
OVERRIDE_CPPFLAGS += \
|
||||
-DSTACK_FRAME_UNLIMITED
|
||||
|
||||
.PHONY: o/$(MODE)/third_party/zip
|
||||
o/$(MODE)/third_party/zip: \
|
||||
$(THIRD_PARTY_ZIP_BINS) \
|
||||
|
|
3
third_party/zip/zipup.c
vendored
3
third_party/zip/zipup.c
vendored
|
@ -48,6 +48,9 @@
|
|||
// MISSING #include "os2/os2zip.h"
|
||||
#endif
|
||||
|
||||
#undef PAGESIZE
|
||||
#define PAGESIZE FRAMESIZE
|
||||
|
||||
#if defined(MMAP)
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/weirdtypes.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue