Dick Hendrickson wrote:
>I wouldn't say it that way.
>
What a nice way of telling me I am wrong :)
Peter S. also said:
There is no cost to allocation on the stack if the stack is big
enough. Unlike typicall malloc/ALLOCATE strategies, the process
doesn't have to call the kernel to grow the virtual address space...
None of us is quite right. These things do depend on the OS+hardware,
for example. It is definitely not true that stack space is by some
miracle "unbounded" and can grow and never shrink, though the kernel
needs not keep the same kind of bookkeeping for it as for heap space, so
you are both more correct then I was in my first post.
If I were a compiler (!?!), I would use heap space for automatic arrays
which I cannot find the size of. If these arrays are big (as they often
will), allocating them on a stack is silly if not impossible.
In any case, I don't know enough about how OS memory management works to
pretend to be an expert. Van should find more reliable ways of improving
performance...
Best,
Aleksandar
|