Closed vdukhovni closed 3 years ago
Nice, thanks for this. I'm going to add a CI job for GHC 9 now that it's available in Stackage Nightly. Once that's in, could you rebase onto master
to make sure this all works with it too?
Nice, thanks for this. I'm going to add a CI job for GHC 9 now that it's available in Stackage Nightly. Once that's in, could you rebase onto
master
to make sure this all works with it too?
Sure. There are some critical bugs in 9.0.1, but with a bit of luck we won't run into them... I hope 9.0.2 will be out soon.
Taking care of this now.
With GHC 9.0
withForeignPtr
was made safe for actions that might loop forever or always throw an exception. This safety comes at the cost of performance, the result is always allocated, which is not ideal for primitive byte-level memory operations.A new
unsafeWithForeignPtr
is added that provides the old non-allocating behaviour when the action is sure to terminate. With GHC 9.0 and later, we use this function to loop over the content of ByteStream chunks.