vector-0.12.3.1: Efficient Arrays
Copyright(c) Roman Leshchinskiy 2009-2010
LicenseBSD-style
MaintainerRoman Leshchinskiy <rl@cse.unsw.edu.au>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Vector.Storable.Internal

Description

Ugly internal utility functions for implementing Storable-based vectors.

Synopsis

Documentation

updPtr :: (Ptr a -> Ptr a) -> ForeignPtr a -> ForeignPtr a Source #

unsafeWithForeignPtr :: ForeignPtr a -> (Ptr a -> IO b) -> IO b #

This is similar to withForeignPtr but comes with an important caveat: the user must guarantee that the continuation does not diverge (e.g. loop or throw an exception). In exchange for this loss of generality, this function offers the ability of GHC to optimise more aggressively.

Specifically, applications of the form: unsafeWithForeignPtr fptr (forever something)

See GHC issue #17760 for more information about the unsoundness behavior that this function can result in.