Skip to content

Commit c19c91e

Browse files
committed
[MERGE #1306 @obastemur] cross-platform: fix stack related issues on macOS
Merge pull request #1306 from obastemur:fixed_stack_osx We have all tests are passing for macOS now. notes on updates: ~~Main thread default stack limit is 8MB while `pthread_get_stacksize_np` may return lower value.~~ ~~OSX implementation of Pthread stack size is 512KB~~ - Sets 64MB process stack limit through macOS linker to match our testing needs edit: removed additional pthread updates. It was kind of a nice to have but at the moment not needed. Going to visit that separately.
2 parents 4bfc9b1 + adf894c commit c19c91e

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

bin/ch/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
set(ch_source_files
1+
set(ch_source_files
22
ch.cpp
33
ChakraRtInterface.cpp
44
CodexAssert.cpp
@@ -67,6 +67,8 @@ if(STATIC_LIBRARY)
6767
icucore
6868
"-framework CoreFoundation"
6969
"-framework Security"
70+
# set stack size to 64Mb for stack tests
71+
-Wl,-stack_size,0x04000000
7072
)
7173
endif() # Linux ?
7274
else() # // !from shared library
@@ -78,7 +80,7 @@ else() # // !from shared library
7880
endif()
7981

8082
if(CMAKE_SYSTEM_NAME STREQUAL Linux)
81-
set(lib_target "${lib_target}"
83+
set(lib_target "${lib_target}"
8284
-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/ch.version
8385
)
8486
endif()

test/Error/stack.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ function DoSomething()
7878

7979
try
8080
{
81-
var count = 20000; // Keep this unrealistic number as we do not
82-
// limit stack memory to a particular capacity
81+
var count = 200000; // Keep this unrealistic number as we do (osx)
82+
// and do not limit stack memory to a particular capacity
8383

8484
var a = {};
8585
var b = a;

0 commit comments

Comments
 (0)