Preventing/handling space leaks

Sven Panne Sven.Panne at
Mon Dec 8 18:16:21 EST 2003

[ Just one more mail and I promise to shut up on this topic... :-) ]

Fergus Henderson wrote:
> [...] C does suffer from many of the same problems as C.  But in C++, it is
> much easier to automate techniques like reference counting, which can
> be done manually in C but are much more cumbersome and error-prone when
> done manually.

Granted, C++'s (copy) constructors, destructors and assignment operators make some
things relatively easy compared to C, but the complexity of handling exceptions
*correctly* makes things worse again: There is a famous article (I can't remember the
title or the author) where a well-known C++ grandmaster explains a stack class,
but another later article by someone else describes the numerous bugs in that class
when exceptions are taken into account.

And one final remark on Haskell and Java: In large projects in those languages you
usually get the "genuine" space leaks in those languages plus all those nice little
leaks from the ubiquitous native functions/methods. So you have to debug in at least
two languages at the same time and I haven't seen combined tool support for this yet...
:-P * * *


More information about the Haskell-Cafe mailing list