diff options
| author | krasimir <krasimir@chalmers.se> | 2017-02-10 17:10:37 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2017-02-10 17:10:37 +0000 |
| commit | 94f41cc63dfc0a55d8957762500eb93f2331e1da (patch) | |
| tree | 5f73bdf28c19bd41e8bda6959da3b9f17383cdfb /src/runtime/haskell-bind/PGF2/FFI.hs | |
| parent | d0f7f9ca8dcc085fcc4061ecd954c283e2d823e3 (diff) | |
safer memory management in the Haskell binding
Diffstat (limited to 'src/runtime/haskell-bind/PGF2/FFI.hs')
| -rw-r--r-- | src/runtime/haskell-bind/PGF2/FFI.hs | 6 |
1 files changed, 4 insertions, 2 deletions
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 |
