Hs2lib-0.5.2: WinDll/Debug/Exports.xhs
{-# LANGUAGE ForeignFunctionInterface #-}
-----------------------------------------------------------------------------
-- |
-- Module : Windll
-- Copyright : (c) Tamar Christina 2009 - 2010
-- License : BSD3
--
-- Maintainer : tamar@zhox.com
-- Stability : experimental
-- Portability : portable
--
-- A module containing memory management exports that will be automatically
-- added to your file when --debug is being used.
--
-----------------------------------------------------------------------------
module WinDll.Debug.Exports where
import qualified WinDll.Debug.Alloc as F ( freeUnknown )
import qualified Foreign.Marshal.Alloc as G
import WinDll.Debug.Stack ()
import Foreign
import Foreign.Ptr
foreign export stdcall "freeS" freeS :: Ptr () -> IO ()
foreign export ccall "freeC" freeC :: Ptr () -> IO ()
foreign export stdcall "recordS" freeS :: Ptr () -> IO ()
foreign export ccall "recordC" freeC :: Ptr () -> IO ()
freeS :: Ptr () -> IO ()
freeS ptr = F.freeUnknown "[External Source]" ptr G.free
freeC :: Ptr () -> IO ()
freeC ptr = F.freeUnknown "[External Source]" ptr G.free
recordS :: Ptr () -> IO ()
recordS ptr = F.freeUnknown "[External Source]" ptr (const (return ()))
recordC :: Ptr () -> IO ()
recordC ptr = F.freeUnknown "[External Source]" ptr (const (return ()))