Is this a bug in multithreading code?
Simon Marlow
simonmar@microsoft.com
Mon, 28 Apr 2003 13:07:10 +0100
=20
> Nick Name <nick.name@inwind.it>
> > You are right, [...]
>=20
> I further conjecture that more than half of all space leaks can be
> identified not by profiling your code but by running the following
> command:
>=20
> grep '+1' *.hs *.lhs
>=20
> I'm half joking but I've found that this one is very common in certain
> kinds of code. =20
Good idea!
Here's another space-leak-avoiding trick: whenever you write Int as a
constructor field, consider writing !Int instead. Same goes for other
basic types and tuples. This pre-emptive space leak avoidance helps us
in GHC quite a bit.
Cheers,
Simon