[GHC] #15638: Make Ptr argument to hGetBuf and hGetBufSome strict
#15638: Make Ptr argument to hGetBuf and hGetBufSome strict -------------------------------------+------------------------------------- Reporter: andrewthad | Owner: (none) Type: task | Status: new Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.4.3 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Currently, we have: {{{ hGetBufSome :: Handle -> Ptr a -> Int -> IO Int hGetBufSome h ptr count = ... hGetBuf :: Handle -> Ptr a -> Int -> IO Int hGetBuf h ptr count }}} I propose putting a bang pattern on the `ptr` argument to both of these functions. Currently, the non-strictness of this argument causes it to be boxed by functions that call it. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15638> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15638: Make Ptr argument to hGetBuf and hGetBufSome strict -------------------------------------+------------------------------------- Reporter: andrewthad | Owner: (none) Type: task | Status: patch Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.4.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => patch Comment: Fixed in Phab:D5149. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15638#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15638: Make Ptr argument to hGetBuf and hGetBufSome strict -------------------------------------+------------------------------------- Reporter: andrewthad | Owner: (none) Type: task | Status: patch Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.4.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Krzysztof Gogolewski <krz.gogolewski@…>): In [changeset:"88130dbe948eaa7f76cf237d8aba17b41fac4904/ghc" 88130dbe/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="88130dbe948eaa7f76cf237d8aba17b41fac4904" base: Add bangs to GHC.IO.Handle.Text hGet* functions Summary: I believe that demand analysis doesn't notice that these are morally strict in the pointer argument due to the `count == 0` special case. Fixes #15638. Test Plan: Validate Reviewers: andrewthad, hvr Reviewed By: andrewthad Subscribers: rwbarton, carter GHC Trac Issues: #15638 Differential Revision: https://phabricator.haskell.org/D5149 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15638#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15638: Make Ptr argument to hGetBuf and hGetBufSome strict -------------------------------------+------------------------------------- Reporter: andrewthad | Owner: (none) Type: task | Status: closed Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.4.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by monoidal): * status: patch => closed * resolution: => fixed -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15638#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC