How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

Malcolm McLean malcolm.mclean5 at btinternet.com
Mon Aug 16 11:31:48 EDT 2010


On Aug 16, 3:14 pm, spinoza1111 <spinoza1... at yahoo.com> wrote:
>
> To build an explicit stack in this program would have been folly, for
> it would have been necessary to either preallocate the stack and thus
> legislate the maximum complexity of source code, or use a lot of
> memory management in the pre-existing runtime heap.
>
The problem is that if you reallocate the stack, you invalidate all
pointers to objects on it. So you have to use handles instead. At
which point you might as well admit that you are no longer programming
in C.
>
>
> You didn't tell us you published a book. Can you identify the
> publisher?- Hide quoted text -
>
It's a print on demand, by Lulu. O'Reilley said they liked it but they
couldn't sell books on C. (I've an open invitation to write a computer
book for them in another language).

I don't really recommend print on demand. The nice thing is that you
can sell the book for about half the price it would cost under a
traditional publishing model. The problem is that people still use
acceptance by a traditional publisher as a filter.





More information about the Python-list mailing list