final revision to GArrow classes
[ghc-base.git] / Foreign / Marshal / Alloc.hs
index 4b35c27..612d2c7 100644 (file)
@@ -1,4 +1,10 @@
-{-# OPTIONS_GHC -XNoImplicitPrelude #-}
+{-# LANGUAGE CPP
+           , NoImplicitPrelude
+           , MagicHash
+           , UnboxedTuples
+           , ForeignFunctionInterface
+  #-}
+
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Foreign.Marshal.Alloc
@@ -16,8 +22,9 @@
 -- foreign functions or to provide space in which compound result values
 -- are obtained from foreign functions.
 -- 
--- If any of the allocation functions fails, a value of 'nullPtr' is
--- produced.  If 'free' or 'reallocBytes' is applied to a memory area
+-- If any of the allocation functions fails, an exception is thrown.
+-- In some cases, memory exhaustion may mean the process is terminated.
+-- If 'free' or 'reallocBytes' is applied to a memory area
 -- that has been allocated with 'alloca' or 'allocaBytes', the
 -- behaviour is undefined.  Any further access to memory areas allocated with
 -- 'alloca' or 'allocaBytes', after the computation that was passed to
@@ -40,6 +47,7 @@ module Foreign.Marshal.Alloc (
   -- ** Local allocation
   alloca,       -- :: Storable a =>        (Ptr a -> IO b) -> IO b
   allocaBytes,  -- ::               Int -> (Ptr a -> IO b) -> IO b
+  allocaBytesAligned,  -- ::        Int -> Int -> (Ptr a -> IO b) -> IO b
 
   -- ** Dynamic allocation
   malloc,       -- :: Storable a =>        IO (Ptr a)
@@ -67,7 +75,6 @@ import GHC.Real
 import GHC.Ptr
 import GHC.Err
 import GHC.Base
-import GHC.Num
 #elif defined(__NHC__)
 import NHC.FFI                  ( FinalizerPtr, CInt(..) )
 import IO                       ( bracket )