[GHC] #13245: Default FD buffer size is not a power of 2

GHC ghc-devs at haskell.org
Thu Feb 9 00:02:55 UTC 2017


#13245: Default FD buffer size is not a power of 2
-------------------------------------+-------------------------------------
           Reporter:  nh2            |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Runtime        |           Version:  8.0.2
  System                             |
           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:
-------------------------------------+-------------------------------------
 From
 https://hackage.haskell.org/package/base-4.9.1.0/docs/src/GHC.IO.FD.html

 {{{
 -- We used to use System.Posix.Internals.dEFAULT_BUFFER_SIZE, which is
 -- taken from the value of BUFSIZ on the current platform.  This value
 -- varies too much though: it is 512 on Windows, 1024 on OS X and 8192
 -- on Linux.  So let's just use a decent size on every platform:
 dEFAULT_FD_BUFFER_SIZE :: Int
 dEFAULT_FD_BUFFER_SIZE = 8096
 }}}

 8096 is not a power of two, and does not agree with the original commit
 message that sets it to 8KB
 (https://github.com/ghc/ghc/blame/master/libraries/base/GHC/IO/FD.hs#L119).

 Confirmed by Simon Marlow on IRC that this is a typo, a mix between 8192
 and 4096.

 I'll send a patch to set it to 8192.

 It would be nice if the fix could be released in both GHC 8.2 and and
 8.0.3.

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


More information about the ghc-tickets mailing list