From 94f41cc63dfc0a55d8957762500eb93f2331e1da Mon Sep 17 00:00:00 2001 From: krasimir Date: Fri, 10 Feb 2017 17:10:37 +0000 Subject: safer memory management in the Haskell binding --- src/runtime/haskell-bind/PGF2/FFI.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/runtime/haskell-bind/PGF2/FFI.hs') diff --git a/src/runtime/haskell-bind/PGF2/FFI.hs b/src/runtime/haskell-bind/PGF2/FFI.hs index 35aa7fa84..d2b5d5365 100644 --- a/src/runtime/haskell-bind/PGF2/FFI.hs +++ b/src/runtime/haskell-bind/PGF2/FFI.hs @@ -10,10 +10,12 @@ import Control.Exception import GHC.Ptr import Data.Int(Int32) +type Touch = IO () + -- | An abstract data type representing multilingual grammar -- in Portable Grammar Format. -data PGF = PGF {pgf :: Ptr PgfPGF, pgfMaster :: ForeignPtr GuPool} -data Concr = Concr {concr :: Ptr PgfConcr, concrMaster :: PGF} +data PGF = PGF {pgf :: Ptr PgfPGF, touchPGF :: Touch} +data Concr = Concr {concr :: Ptr PgfConcr, touchConcr :: Touch} ------------------------------------------------------------------ -- libgu API -- cgit v1.2.3