Skip to content
Snippets Groups Projects
Commit c64f5375 authored by tora@zonetora.co.uk's avatar tora@zonetora.co.uk
Browse files

Use a fixed size value when reading from Memory for ModuleInfo's

parent c755b110
No related branches found
No related tags found
No related merge requests found
......@@ -40,7 +40,7 @@ modInfo = unsafePerformIO $ do
ptr <- hs_hpc_rootModule
moduleInfoList ptr
data ModuleInfo = ModuleInfo String Int Hash (Ptr Word64)
data ModuleInfo = ModuleInfo String Word32 Hash (Ptr Word64)
moduleInfoList :: Ptr () -> IO [ModuleInfo]
moduleInfoList ptr
......@@ -57,7 +57,7 @@ moduleInfoList ptr
clearTix :: IO ()
clearTix = do
sequence_ [ pokeArray ptr $ take count $ repeat 0
sequence_ [ pokeArray ptr $ take (fromIntegral count) $ repeat 0
| ModuleInfo _mod count _hash ptr <- modInfo
]
return ()
......@@ -65,8 +65,8 @@ clearTix = do
examineTix :: IO Tix
examineTix = do
mods <- sequence [ do tixs <- peekArray count ptr
return $ TixModule mod' hash count
mods <- sequence [ do tixs <- peekArray (fromIntegral count) ptr
return $ TixModule mod' hash (fromIntegral count)
$ map fromIntegral tixs
| (ModuleInfo mod' count hash ptr) <- modInfo
]
......@@ -82,7 +82,7 @@ updateTix (Tix modTixes)
| (ModuleInfo mod1 count1 hash1 ptr,
TixModule mod2 hash2 count2 tixs) <- zip modInfo modTixes
, if mod1 /= mod2
|| count1 /= count2
|| (fromIntegral count1) /= count2
|| hash1 /= hash2
|| length tixs /= count2
then error "updateTix failed"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment