7

I developed a command line application on Linux which needs its stack to be increased. On Linux I just used the workaround: ulimit -s unlimited before running the program. On Mac OS X, command line with G++, I add to the compilation options:

-Wl,-stack_size,0x10000000

and it works.

Now I am developing this program with XCODE, where should I add this option?

1
  • Is that the largest possible stack size? Commented Aug 20, 2020 at 17:20

2 Answers 2

8

From the project window:

Targets > [Your target] > info > Build > Other Linker Flags > [your flags]

Sign up to request clarification or add additional context in comments.

1 Comment

thanks as -Wl,-stack_size,0x10000000 or -stack_size,0x10000000 ?
0

The answer is yes, you can, but under certain conditions. Lets see what does the Swift documenation says about this.

var stackSize: Int { get set }

This value must be in bytes and a multiple of 4KB. To change the stack size, you must set this property before starting your thread. Setting the stack size after the thread has started changes the attribute size (which is reflected by the stackSize method), but it does not affect the actual number of pages set aside for the thread.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.