Make lines stricter to fix a space leak

Daniel Fischer daniel.is.fischer at web.de
Sat Sep 25 10:18:33 EDT 2010


On Saturday 25 September 2010 13:30:11, Ian Lynagh wrote:
> We ought to put the old definition into the H98 and H2010 packages,
> though. Hmm, but currently Prelude always comes from base.
>

Hmm, that is a problem. I suppose one could argue for interpreting

"In this chapter the entire Haskell Prelude is given. It constitutes a 
specification for the Prelude."

somewhat laxer, but that smells of weaseling out.

On the other hand,

"GHC's implementation of array takes the value of an array slot from the 
last (index,value) pair in the list, and does no checking for duplicates. 
The reason for this is efficiency, pure and simple."

, so there's a precedence for

#ifdef __GLASGOW_HASKELL__
non-leaking implementation for GHC
#else
report implementation
#endif

It's not ideal, but the space leak may be a serious issue (cf. 
http://www.haskell.org/pipermail/haskell-cafe/2010-September/083177.html
where Henning Thielemann wrote
"I got several space leaks of this kind in the past. They are very
annoying. They are especially annoying if input comes from the outside
world, where people can attack them to crash your program because of
memory exhaustion.").

>
> Thanks
> Ian
>
Cheers,
Daniel



More information about the Libraries mailing list