[GHC] #7067: Add alignment-restricted ForeignPtr allocation actions
GHC
cvs-ghc at haskell.org
Wed Jul 11 15:49:55 CEST 2012
#7067: Add alignment-restricted ForeignPtr allocation actions
------------------------------+---------------------------------------------
Reporter: nicolast | Owner:
Type: feature request | Status: new
Priority: normal | Component: libraries/base
Version: | Keywords:
Os: Unknown/Multiple | Architecture: Unknown/Multiple
Failure: None/Unknown | Testcase:
Blockedby: | Blocking:
Related: |
------------------------------+---------------------------------------------
Whilst GHC.ForeignPtr exports some actions to allocate buffers containing
an element of some type, or of some specific byte-length efficiently, and
there's an implementation of newAlignedPinnedByteArray# used internally,
there's no way to request such buffer of a given size and at a given
alignment.
The ability to enforce a specific alignment for some memory buffer is
important e.g. when working with SIMD instructions (which is my original
use-case). My attempts to work-around the lack of this function failed
miserably (with a reproducible test-case) as mentioned in [1].
[1] http://www.haskell.org/pipermail/glasgow-haskell-
users/2012-July/022579.html
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7067>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list