[GHC] #10830: maximumBy has a space leak

GHC ghc-devs at haskell.org
Tue Sep 22 10:50:01 UTC 2015


#10830: maximumBy has a space leak
-------------------------------------+-------------------------------------
        Reporter:  NeilMitchell      |                   Owner:
            Type:  bug               |                  Status:  closed
        Priority:  normal            |               Milestone:  7.10.3
       Component:  libraries/base    |                 Version:  7.10.2
      Resolution:  fixed             |                Keywords:
Operating System:  Windows           |            Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:  Phab:D1205
-------------------------------------+-------------------------------------

Comment (by NeilMitchell):

 I'm a little confused. The diff fixes foldr1, I can't quite understand how
 any version based on foldr1 could ever avoid the space leak - although I
 agree that the inlining may reduce the space leak by a constant factor. I
 also note that the test has 100K of stack, while with GHC 7.8 it was fine
 in 1K of stack - perhaps the test bound should be significantly reduced?
 And finally, the code as currently written, maximumBy calls foldl not
 foldr, did that change after your patch went in?

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10830#comment:12>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list