Re: Help needed to decide amount of stack space

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux