Makefile/CMakeLists.txt: factor out stack size setting to here.
This commit is contained in:
parent
9c521a70d6
commit
02196e2efa
|
|
@ -118,7 +118,10 @@ endif (CMAKE_USE_PTHREADS_INIT)
|
|||
#FIXME: Should be only for qbsp
|
||||
add_definitions(-DDOUBLEVEC_T)
|
||||
|
||||
set(STACKSIZE 8388608)
|
||||
add_definitions(-DQ_STACKSIZE=${STACKSIZE})
|
||||
|
||||
#request 8MB stack
|
||||
if (WIN32)
|
||||
set(CMAKE_EXE_LINKER_FLAGS -Wl,--stack,8388608)
|
||||
set(CMAKE_EXE_LINKER_FLAGS -Wl,--stack,${STACKSIZE})
|
||||
endif (WIN32)
|
||||
|
|
|
|||
8
Makefile
8
Makefile
|
|
@ -116,6 +116,14 @@ CFLAGS += $(call cc-option,-ffast-math,)
|
|||
endif
|
||||
endif
|
||||
|
||||
# give a generous 8MB stack
|
||||
STACKSIZE := 8388608
|
||||
CFLAGS += -DQ_STACKSIZE=$(STACKSIZE)
|
||||
|
||||
ifeq ($(TARGET_OS),WIN32)
|
||||
LDFLAGS += -Wl,--stack,$(STACKSIZE)
|
||||
endif
|
||||
|
||||
# ============================================================================
|
||||
# Helper functions
|
||||
# ============================================================================
|
||||
|
|
|
|||
|
|
@ -233,7 +233,7 @@ RunThreadsOn(int start, int workcnt, void *(func)(void *), void *arg)
|
|||
status = pthread_attr_init(&attrib);
|
||||
if (status)
|
||||
Error("pthread_attr_init failed");
|
||||
status = pthread_attr_setstacksize(&attrib, 0x100000);
|
||||
status = pthread_attr_setstacksize(&attrib, Q_STACKSIZE);
|
||||
if (status)
|
||||
Error("pthread_attr_setstacksize failed");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue