{-# LANGUAGE TupleSections #-}{-# LANGUAGE ForeignFunctionInterface #-}moduleGHCi.StaticPtrTable(sptAddEntry )whereimportPrelude-- See note [Why do we import Prelude here?]importData.WordimportForeignimportGHC.FingerprintimportGHCi.RemoteTypes -- | Used by GHCi to add an SPT entry for a set of interactive bindings.sptAddEntry::Fingerprint->HValue ->IO()sptAddEntry (Fingerprinta b )(HValue x )=do-- We own the memory holding the key (fingerprint) which gets inserted into-- the static pointer table and can't free it until the SPT entry is removed-- (which is currently never).fpr_ptr <-newArray[a ,b ]sptr <-newStablePtrx ent_ptr <-mallocpokeent_ptr (castStablePtrToPtrsptr )spt_insert_stableptr fpr_ptr ent_ptr foreignimportccall"hs_spt_insert_stableptr"spt_insert_stableptr::PtrWord64->Ptr(Ptr())->IO()

AltStyle によって変換されたページ (->オリジナル) /