Hoogle Search

Within LTS Haskell 24.38 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. utf8DecodeForeignPtr :: ForeignPtr Word8 -> Int -> Int -> [Char]

    base GHC.Encoding.UTF8

    No documentation available.

  2. data FFFormat

    base GHC.Float

    No documentation available.

  3. PlainForeignPtr :: !IORef Finalizers -> ForeignPtrContents

    base GHC.ForeignPtr

    The pointer refers to unmanaged memory that was allocated by a foreign function (typically using malloc). The finalizer frequently calls the C function free or some variant of it.

  4. addForeignPtrConcFinalizer :: ForeignPtr a -> IO () -> IO ()

    base GHC.ForeignPtr

    This function adds a finalizer to the given ForeignPtr. The finalizer will run before all other finalizers for the same object which have already been registered. This is a variant of addForeignPtrFinalizer, where the finalizer is an arbitrary IO action. When finalization is triggered by GC, the finalizer will run in a new thread. When finalization is triggered by explicitly calling finalizeForeignPtr, the finalizer will run immediately on the current Haskell thread. NB. Be very careful with these finalizers. One common trap is that if a finalizer references another finalized value, it does not prevent that value from being finalized. In particular, Handles are finalized objects, so a finalizer should not refer to a Handle (including stdout, stdin, or stderr).

  5. addForeignPtrFinalizer :: FinalizerPtr a -> ForeignPtr a -> IO ()

    base GHC.ForeignPtr

    This function adds a finalizer to the given foreign object. The finalizer will run before all other finalizers for the same object which have already been registered.

  6. addForeignPtrFinalizerEnv :: FinalizerEnvPtr env a -> Ptr env -> ForeignPtr a -> IO ()

    base GHC.ForeignPtr

    Like addForeignPtrFinalizer but the finalizer is passed an additional environment parameter.

  7. castForeignPtr :: ForeignPtr a -> ForeignPtr b

    base GHC.ForeignPtr

    This function casts a ForeignPtr parameterised by one type into another type.

  8. finalizeForeignPtr :: ForeignPtr a -> IO ()

    base GHC.ForeignPtr

    Causes the finalizers associated with a foreign pointer to be run immediately. The foreign pointer must not be used again after this function is called. If the foreign pointer does not support finalizers, this is a no-op.

  9. mallocForeignPtr :: Storable a => IO (ForeignPtr a)

    base GHC.ForeignPtr

    Allocate some memory and return a ForeignPtr to it. The memory will be released automatically when the ForeignPtr is discarded. mallocForeignPtr is equivalent to

    do { p <- malloc; newForeignPtr finalizerFree p }
    
    although it may be implemented differently internally: you may not assume that the memory returned by mallocForeignPtr has been allocated with malloc. GHC notes: mallocForeignPtr has a heavily optimised implementation in GHC. It uses pinned memory in the garbage collected heap, so the ForeignPtr does not require a finalizer to free the memory. Use of mallocForeignPtr and associated functions is strongly recommended in preference to newForeignPtr with a finalizer.

  10. mallocForeignPtrAlignedBytes :: Int -> Int -> IO (ForeignPtr a)

    base GHC.ForeignPtr

    This function is similar to mallocForeignPtrBytes, except that the size and alignment of the memory required is given explicitly as numbers of bytes.

Page 398 of many | Previous | Next