Thank you for the education everyone! These excellent posts will help me
create the best-possible design.
- dan elliott
On Wed, 17 Nov 2004 19:57:17 -0800, E. Robert Tisdale wrote:
> Prash wrote:
>
>> Stack is there for automatic variables and its size is limited.
>> So, I suggest that you use heap for your data storage.
>
> Actually, automatic storage [the program stack]
> and free storage [the heap] share the same virtual memory.
> The typical program stack grows up from the bottom of virtual memory
> and the heap grows downward to the top of the stack.
>
> The stack size may be limited but can be easily increased
> using shell commands or compiler options.
> For example, on a Linux workstation:
>
> > limit stacksize
> stacksize 10240 kbytes
> > limit stacksize unlimited
> > limit stacksize
> stacksize unlimited
>
>> If [you] have performace to consider, then see to it that some time
>> object creation and deletion might take and you should minimize on that;
>> like, instead of allocation 10 small memory chunks,
>> you can create a larger chunk of memory and then divide it by yourself.
>>
>> Also, I'd suggest you not to use variable sized arrays
>> as they are implemented in libraries using lists or something
>> and access to them is definetly slower
>> than the fixed sized conventional arrays.
>
> No!
>
> C99 style variable size arrays
>
> http://gcc.gnu.org/ml/gcc/2004-05/msg00746.html
>
> are allocated from free storage [the stack]
> and have performance characteristics similar to "conventional arrays".
>
>> Also, maybe you can have a look at the GNU Scientific library
>> as an option for components. www.gnu.org/software/gsl/
>
> You may as well check out
> the Vector, Signal and Image Processing Library
>
> http://www.vsipl.org/
>
> or, better yet,
> the High Performance Embedded Computing Software Initiative
>
> http://www.hpec-si.org/
>
> which actually proposes a C++ language binding.