public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Help needed to decide amount of stack space
@ 2004-09-09  6:13 Sriharsha Vedurmudi
       [not found] ` <6.1.2.0.2.20040909062851.02d6cc98@iplan-mn.corp.adobe.com>
  0 siblings, 1 reply; 2+ messages in thread
From: Sriharsha Vedurmudi @ 2004-09-09  6:13 UTC (permalink / raw)
  To: gcc

Hi,

    I am stuck with a problem and need someone with reasonable
experience to guide me.

  We have developed a Custom DSP processor (16-bit, dual threaded) and
had a version of gcc ported onto it. Now, the firm that ported it,
limited the stack to 4k. We are planning to port an RTOS (ucLinux or
uCos) onto it and later develop some applications for VoIP and advanced
Wireless solutions in it. So, I want to know, if 4k of stack space is
sufficient for such programs.

Regards,
Sriharsha.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Help needed to decide amount of stack space
       [not found] ` <6.1.2.0.2.20040909062851.02d6cc98@iplan-mn.corp.adobe.com>
@ 2004-09-09 11:48   ` Sriharsha Vedurmudi
  0 siblings, 0 replies; 2+ messages in thread
From: Sriharsha Vedurmudi @ 2004-09-09 11:48 UTC (permalink / raw)
  To: gcc

Hi Eljay,

    Thanks for the response. Ya, I know that its very much 
application-and-developer-dependent to decide the amount of stack space 
required, So I wanted a rough worst-case scenario of a voice-application 
algorithm.
    Anyway, we are negotiating with the providers to incorporate stack 
the traditional way (start at the upper available memory and grow 
downwards).

Cheers,
Harsha.


Eljay Love-Jensen wrote:

> Hi Sriharsha,
>
> I worked with a Custom DSP with 256 bytes of stack space.  (Life 
> became better with the next generation, where we had 65536 bytes of 
> stack space carved out of 1 MB (!) of RAM, plus (2) 512 KB chunks of 
> FlashROM and a 512 KB fallback ROM.  Upgrading was never so sweet!)
>
> So is 4096 bytes enough...?  Depends.  The developers must be aware of 
> the tight constraint.  No recursive calls!  Probably no C++, only C.  
> Or if you do C++, you'd have to enforce some draconian coding 
> conventions to avoid blowing the stack out of the water.
>
> No pushing objects on the stack (C++)!
>
> If you are doing C, you'll probably notice that C becomes even closer 
> to being used as an Assembly Macro Language.  :-)
>
> Do you have a good C ABI, such that you'll *KNOW* where the parameters 
> are pushed?  (What am I getting at?  In our implementation, we could 
> annotate the function parameters with which register was used for the 
> parameter.  We used that extensively to avoid using stack.)
>
> Good luck!  (Oh, the memories.  The nightmares.  The ulcers.)
>
> --Eljay
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-09-09 11:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-09  6:13 Help needed to decide amount of stack space Sriharsha Vedurmudi
     [not found] ` <6.1.2.0.2.20040909062851.02d6cc98@iplan-mn.corp.adobe.com>
2004-09-09 11:48   ` Sriharsha Vedurmudi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).