Changes between Initial Version and Version 1 of Ticket #8281, comment 18


Ignore:
Timestamp:
May 12, 2017 3:06:57 AM (19 months ago)
Author:
winter
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #8281, comment 18

    initial v1  
    22> @winter it's always wrong to pass an unpinned `ByteArray#` to a foreign call, regardless of whether the call is annotated as `safe` or `unsafe`, because GHC is free to implement an `unsafe` call as a `safe` call.  Indeed we do this in GHCi.
    33
    4 But lots of packages(text, for example) seems to be relying on this assumption, as you pointed out, text implemented its copy with FFI memcpy rather than a `copyByteArray#`.
     4But lots of packages(text, for example) seems to be relying on this assumption. Like your example suggest, text also implemented its copy with FFI memcpy rather than a `copyByteArray#`, and small texts are no way pinned.