Each Mac OS X process is launched with a default stack size of 8 Megabytes. This allocation is used exclusively for the main thread's stack needs. Each subsequent thread created is allocated its own default stack, the size of which differs depending on the threading API used. For example, the Mac OS X implementation of Pthreads defines a default stack size of 512 Kilobytes, while Carbon MPTasks are created with a 4 Kilobyte stack.
Since certain system defaults and limits can change between releases of Mac OS X, it is useful to be able to determine the default process stack size for the system you are developing on. From the command line, limit (csh, tcsh) or ulimit -a (sh, bash) will output a variety of system defaults including the default process stack size.
If you find your application is crashing because it is outgrowing the default 8 Megabyte stack allocation, you can raise its default by passing the -stack_size flag on the link line and specifying a new stack size up to 64 Megabytes.
Setting a Larger Stack at Link Time:
------------------------------------
Using gcc, pass link flags through to ld with -Wl:
gcc -Wl,-stack_size -Wl,1000000 foo.c
For details follow the link
Subscribe to:
Post Comments (Atom)
Down with the Dictatorship!
"Let them hate me, so that they fear me" - Caligula 41AD
-
To install pngwrite we need to install to helper library before we install pngwriter. 1. libpng 2. freetype2 We can use fink or macport to i...
-
Health benefit and values
-
It started on a rainy day. So1ace was one of the best friends I had ever in my life. He arrived in my life on 29th January 2013. I spent 3 ...
No comments:
Post a Comment