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

Modulebasement-0.0.16Haskell2010

Basement.FinalPtr

A smaller ForeignPtr reimplementation that work in any prim monad.

Here be dragon.

  • 1 type
  • 8 values
  • Packagebasement-0.0.16
  • Exports9
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceFinalPtr.hs
valuefinalPtrSameMemory :: FinalPtr a -> FinalPtr b -> Bool
#

Check if 2 final ptr points on the same memory bits

it stand to reason that provided a final ptr that is still being referenced and thus have the memory still valid, if 2 final ptrs have the same address, they should be the same final ptr

valuewithFinalPtr :: PrimMonad prim => FinalPtr p -> (Ptr p -> prim a) -> prim a
#

Looks at the raw pointer inside a FinalPtr, making sure the data pointed by the pointer is not finalized during the call to f