Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Enlarge the stack size in gcc ?

Reply
Thread Tools

Enlarge the stack size in gcc ?

 
 
Qoo
Guest
Posts: n/a
 
      06-21-2005


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 : (

 
Reply With Quote
 
 
 
 
David Resnick
Guest
Posts: n/a
 
      06-21-2005
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

 
Reply With Quote
 
 
 
 
Roger Leigh
Guest
Posts: n/a
 
      06-21-2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

"Qoo" <(E-Mail Removed)> 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-----
 
Reply With Quote
 
Anonymous 7843
Guest
Posts: n/a
 
      06-21-2005
In article <(E-Mail Removed) .com>,
Qoo <(E-Mail Removed)> 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++
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
C/C++ compilers have one stack for local variables and return addresses and then another stack for array allocations on the stack. Casey Hawthorne C Programming 3 11-01-2009 08:23 PM
stack frame size on linux/solaris of a running application stack Surinder Singh C Programming 1 12-20-2007 01:16 PM
Can we determine stack size & Heap size at runtime ? sunny C Programming 5 08-17-2006 12:17 AM
You can enlarge a tire but you can't enlarge a photo =?iso-8859-1?Q?mark=5Fdigital=A9?= Digital Photography 11 03-08-2006 03:10 AM
gcc executable size vs. target hex file size? scrodchunk C Programming 2 07-06-2004 01:35 AM



Advertisments