Enlarge the stack size in gcc ?

Discussion in 'C Programming' started by Qoo, Jun 21, 2005.

  1. Qoo

    Qoo Guest

    Is there any tools like "stubedit" can let me enlarge the stack size
    under linux ?

    And I was quite wondering what's the default stack size of the program
    compiled with gcc without any parameter ?

    Sorry for my poor english : (
     
    Qoo, Jun 21, 2005
    #1
    1. Advertising

  2. Qoo wrote:
    > Is there any tools like "stubedit" can let me enlarge the stack size
    > under linux ?
    >
    > And I was quite wondering what's the default stack size of the program
    > compiled with gcc without any parameter ?
    >
    > Sorry for my poor english : (


    All off topic here, this is a newgroup about the "C" language rather
    than on particular implementation. Give gnu.gcc.help a try. Followups
    set there.

    -David
     
    David Resnick, Jun 21, 2005
    #2
    1. Advertising

  3. Qoo

    Roger Leigh Guest

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    "Qoo" <> writes:

    [comp.os.linux.development.apps is a more appropriate place than
    comp.lang.c. Followups set.]

    > Is there any tools like "stubedit" can let me enlarge the stack size
    > under linux ?


    No. The stack size is not set in the ELF binary. It's a settable
    user resource limit; see RLIMIT_STACK in setrlimit(2).

    Have you run out of stack space? Unless you set some really tiny
    limits, it should be able to grow *very* large.

    On my system, it's set to 8 KiB:

    $ ulimit -s
    8192

    Change it with the ulimit bash builtin, or setrlimit(), or at login
    with PAM (pam_limits.so).

    > And I was quite wondering what's the default stack size of the program
    > compiled with gcc without any parameter ?


    See above: there is *no such thing* as a "default stack size" of a
    binary. GNU/Linux is not DOS (i.e. broken).


    Regards,
    Roger

    - --
    Roger Leigh
    Printing on GNU/Linux? http://gimp-print.sourceforge.net/
    Debian GNU/Linux http://www.debian.org/
    GPG Public Key: 0x25BFB848. Please sign and encrypt your mail.
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.1 (GNU/Linux)
    Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>

    iD8DBQFCuISVVcFcaSW/uEgRAh2QAJ9aB6w0TGRHpfOMe7S+OlWFTkm4lgCfbYnT
    bviq/0jiUbdaiBAw57h5t98=
    =rlam
    -----END PGP SIGNATURE-----
     
    Roger Leigh, Jun 21, 2005
    #3
  4. In article <>,
    Qoo <> wrote:
    >
    >Is there any tools like "stubedit" can let me enlarge the stack size
    >under linux ?


    You might want to ask that in a linux-related newsgroup.

    The C-related advice is that if you're using so much stack
    that you need more...you're probably abusing the stack.
    Don't do that.

    - Use iteration in preference to recursion when appropriate
    - If the nature of what you're doing demands recursion, investigate
    alternative algorithms that don't recurse as deeply
    - Put large objects into the heap instead of on the stack
    - Pass pointers to large things instead of copying them

    Just a start.
    --
    7842++
     
    Anonymous 7843, Jun 21, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shamli
    Replies:
    4
    Views:
    1,022
    Rafal 'Raf256' Maj
    Oct 11, 2003
  2. K.

    a href area to enlarge

    K., Jun 22, 2007, in forum: HTML
    Replies:
    11
    Views:
    1,261
    dorayme
    Jun 24, 2007
  3. robos85

    PIL how to enlarge image

    robos85, Dec 4, 2010, in forum: Python
    Replies:
    1
    Views:
    381
    Alain Ketterlin
    Dec 4, 2010
  4. Stefan Salewski
    Replies:
    2
    Views:
    133
    Stefan Salewski
    Apr 12, 2011
  5. Eraserhead

    Click to enlarge issues

    Eraserhead, Jul 23, 2003, in forum: Javascript
    Replies:
    2
    Views:
    115
    Hywel Jenkins
    Jul 24, 2003
Loading...

Share This Page