> Would you (in the case you sketch) sleep well with a stack allocated > based on your assumption? Nope :-) I have to admit that in some cases the stack is worse in the way that it is quite hard to calculate the usage by hand. In the worse case the stack overwrites RAM area that was used for static data - for example the stack is built from the top RAM to towards the bottom, while the static variables or heap is from the bottom to the top, and in worse case the stack can grow that much that it overwrites some data from the static or heap area. Considering this it is better to use a more predictable method, like this "static stack". Tamas On Fri, Oct 24, 2008 at 3:24 PM, Wouter van Ooijen wrote: > > I thought this technique is based on function references, so that if > there > > is a switch-case or an if structure where the condition cannot be > calculated > > or predicted at compile time, then the compiler will not be able to tell > > when is the function going to be called, so it assumes that at any point > the > > function name was referenced? > > Yes. > > Would you (in the case you sketch) sleep well with a stack allocated > based on your assumption? > > But I have to agree, there are cases where the 'worst case' won't be > reached. > > -- > > Wouter van Ooijen > > -- ------------------------------------------- > Van Ooijen Technische Informatica: www.voti.nl > consultancy, development, PICmicro products > docent Hogeschool van Utrecht: www.voti.nl/hvu > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- Rudonix DoubleSaver http://www.rudonix.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist