[rescue] Mozilla Firefox

Jonathan C. Patschke jp at celestrion.net
Fri Apr 23 14:22:31 CDT 2004


On Fri, 23 Apr 2004, Charles Shannon Hendrix wrote:

> Look, I'm not saying it is impossible, and in most cases it is actually
> quite easy.  But at the same time, a good automatic memory system will
> often do a very good job.  Nothing is perfect of course.

Right, but it's hard to get -just- automatic memory management without
having to cart around all the other bulk that such environments throw on
you.

> External pointers to stack memory and areas that had been free()'d were
> common, particular in some data filter code they had.  In fact, I've
> found this in a lot of C code.

My solution for that is REALLY good documentation on what sorts of data
is returned and taken by a function.  Knowing that a function returns
statically-allocated memory or memory to be free()ed later, or knowing
that it does a deep-copy of the input, or just a reference-copy (or
perhaps not a copy at all) is almost more important than knowing what
the function does.

> One programmer told me that this was OK, because the system would not
> re-use memory areas allocated with malloc() if it was still referenced.

Ugh.  Isn't it amazing how people can simultaneously give computers too
much and too little credit?

-- 
Jonathan Patschke  ) "Being on the Internet is not the same as being
Elgin, TX         (   famous.  That's like calling Cheetos 'dinner'."
USA                )                                    --Metal Steve



More information about the rescue mailing list