HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

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