[GHC] #15653: Both `Ptr a` in SerializedCompact are inaccurate because of the `a`

GHC ghc-devs at haskell.org
Tue Sep 18 20:05:05 UTC 2018


#15653: Both `Ptr a` in SerializedCompact are inaccurate because of the `a`
-------------------------------------+-------------------------------------
           Reporter:  chessai        |             Owner:  ezyang
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:  8.8.1
          Component:                 |           Version:  8.4.3
  libraries/compact                  |
           Keywords:  ghc-compact,   |  Operating System:  Unknown/Multiple
  compact regions                    |
       Architecture:                 |   Type of failure:  Incorrect API
  Unknown/Multiple                   |  annotation
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 {{{SerializedCompactPtr}}} is defined as:

 {{{#!hs
 data SerializedCompact a = SerializedCompact
   { serializedCompactBlockList :: [(Ptr a, Word)]
   , serializedCompactRoot :: Ptr a
   }
 }}}

 But, these {{{Ptr a}}} values are a lie, because they don't point to
 something of type 'a', which makes the documentation for {{{ghc-compact}}}
 sort of confusing to look at. A more accurate type would just be
 {{{Addr}}}.

 The consequences of this being changes to {{{Addr}}} are
 1: breaking API changes (though not many people use compact regions)
 2: A dependency on primitive would be necessary, though I'm again unsure
 how big of a deal this is, given that ghc-compact already depends on
 bytestring. ({{{Addr}}} should probably be moved to base, and re-exported
 from primitive, which would avoid this issue.)

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


More information about the ghc-tickets mailing list