HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulerebase-1.21.2Haskell2010

Rebase.Foreign.Marshal.Pool

  • 1 type
  • 14 values
  • Packagerebase-1.21.2
  • Exports15
  • LanguageHaskell2010
  • LicenceMIT
  • SourcePool.hs
newtypenewtype Pool
#

A memory pool.

valuefreePool :: Pool -> IO ()
#

Deallocate a memory pool and everything which has been allocated in the pool itself.

valuepooledMalloc :: Storable a => Pool -> IO (Ptr a)
#

Allocate space for storable type in the given pool. The size of the area allocated is determined by the sizeOf method from the instance of Storable for the appropriate type.

valuepooledMallocArray0 :: Storable a => Pool -> Int -> IO (Ptr a)
#

Allocate storage for the given number of elements of a storable type in the pool, but leave room for an extra element to signal the end of the array.

valuepooledNew :: Storable a => Pool -> a -> IO (Ptr a)
#

Allocate storage for a value in the given pool and marshal the value into this storage.

valuepooledNewArray :: Storable a => Pool -> [a] -> IO (Ptr a)
#

Allocate consecutive storage for a list of values in the given pool and marshal these values into it.

valuepooledNewArray0 :: Storable a => Pool -> a -> [a] -> IO (Ptr a)
#

Allocate consecutive storage for a list of values in the given pool and marshal these values into it, terminating the end with the given marker.

valuepooledReallocBytes :: Pool -> Ptr a -> Int -> IO (Ptr a)
#

Adjust the storage area for an element in the pool to the given size. Note that the previously allocated space is still retained in the same Pool and will only be freed when the entire Pool is freed.

valuewithPool :: (Pool -> IO b) -> IO b
#

Execute an action with a fresh memory pool, which gets automatically deallocated (including its contents) after the action has finished.