[GHC] #13894: isByteArrayPinned# should consider BF_LARGE

GHC ghc-devs at haskell.org
Thu Jun 29 05:35:52 UTC 2017


#13894: isByteArrayPinned# should consider BF_LARGE
-------------------------------------+-------------------------------------
           Reporter:  winter         |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.1
           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:
-------------------------------------+-------------------------------------
 First of all, i want to make sure `isByteArrayPinned#` is intended to let
 user know if a given 'ByteArray#/MutableByteArray#' is movable during safe
 FFI call, isn't it?

 If that is the case, then the code for `stg_isByteArrayPinnedzh` is not
 enough, since not only bytes marked with `BF_PINNED` flag is not movable,
 but also the bytes which is marked with `BF_LARGE`. (I read the gc code
 and i'm confident this holds, but if it's not, please correct me).

 Currently i'm using a FFI
 trick[https://github.com/winterland1989/stdio/blob/master/cbits/bytes.c#L33]
 to get `isByteArrayPinned#` on older GHCs, i want to make sure if
 `BF_LARGE` works.

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


More information about the ghc-tickets mailing list