Commit 226c5352 authored by shlevy's avatar shlevy Committed by Ben Gamari
Browse files

base: Add Foreign.ForeignPtr.plusForeignPtr.

Reviewers: simonmar, austin, hvr, bgamari

Reviewed By: bgamari

Subscribers: RyanGlScott, thomie

Differential Revision: https://phabricator.haskell.org/D2900
parent 12ad4d41
......@@ -35,6 +35,7 @@ module Foreign.ForeignPtr (
-- ** Low-level operations
, touchForeignPtr
, castForeignPtr
, plusForeignPtr
-- ** Allocating managed memory
, mallocForeignPtr
......
......@@ -38,6 +38,7 @@ module Foreign.ForeignPtr.Imp
, unsafeForeignPtrToPtr
, touchForeignPtr
, castForeignPtr
, plusForeignPtr
-- ** Allocating managed memory
, mallocForeignPtr
......
......@@ -39,6 +39,7 @@ module GHC.ForeignPtr
touchForeignPtr,
unsafeForeignPtrToPtr,
castForeignPtr,
plusForeignPtr,
newConcForeignPtr,
addForeignPtrConcFinalizer,
finalizeForeignPtr
......@@ -434,6 +435,12 @@ castForeignPtr :: ForeignPtr a -> ForeignPtr b
-- parameterised by one type into another type.
castForeignPtr = coerce
plusForeignPtr :: ForeignPtr a -> Int -> ForeignPtr b
-- ^Advances the given address by the given offset in bytes.
--
-- @since 4.10.0.0
plusForeignPtr (ForeignPtr addr c) (I# d) = ForeignPtr (plusAddr# addr d) c
-- | Causes the finalizers associated with a foreign pointer to be run
-- immediately.
finalizeForeignPtr :: ForeignPtr a -> IO ()
......
......@@ -35,6 +35,8 @@
* Raw buffer operations in `GHC.IO.FD` are now strict in the buffer, offset, and length operations (#9696)
* Add `plusForeignPtr` to `Foreign.ForeignPtr`.
## 4.9.0.0 *May 2016*
* Bundled with GHC 8.0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment