summaryrefslogtreecommitdiff
path: root/testsuite/tests/rts/unload_multiple_objs/A.hs
blob: 5ae19545df84a247dcf6ae579f1a2ff546ec528a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
module A where

import Foreign.StablePtr

id1 :: Int
id1 = 1

createHeapObjectA :: IO (StablePtr [Int])
createHeapObjectA = do
  newStablePtr [2+id1]

freeHeapObjectA :: StablePtr [Int] -> IO ()
freeHeapObjectA obj = freeStablePtr obj

foreign export ccall createHeapObjectA :: IO (StablePtr [Int])
foreign export ccall freeHeapObjectA   :: StablePtr [Int] -> IO ()