Stop using deprecated functions

This commit is contained in:
Andrzej Rybczak 2023-10-26 18:42:19 +02:00
parent b92dc37a7b
commit 73fd305807

View File

@ -133,9 +133,9 @@ emptyEnv = Env 0
cloneEnv :: Env es -> IO (Env es) cloneEnv :: Env es -> IO (Env es)
cloneEnv (Env offset refs storage0) = do cloneEnv (Env offset refs storage0) = do
Storage storageSize version vs0 es0 fs0 <- readIORef' storage0 Storage storageSize version vs0 es0 fs0 <- readIORef' storage0
let vsSize = sizeofMutablePrimArray vs0 vsSize <- getSizeofMutablePrimArray vs0
esSize = sizeofSmallMutableArray es0 esSize <- getSizeofSmallMutableArray es0
fsSize = sizeofSmallMutableArray fs0 fsSize <- getSizeofSmallMutableArray fs0
when (vsSize /= esSize) $ do when (vsSize /= esSize) $ do
error $ "vsSize (" ++ show vsSize ++ ") /= esSize (" ++ show esSize ++ ")" error $ "vsSize (" ++ show vsSize ++ ") /= esSize (" ++ show esSize ++ ")"
when (esSize /= fsSize) $ do when (esSize /= fsSize) $ do
@ -377,7 +377,7 @@ insertEffect
-> IO (Int, Int) -> IO (Int, Int)
insertEffect storage e f = do insertEffect storage e f = do
Storage size version vs0 es0 fs0 <- readIORef' storage Storage size version vs0 es0 fs0 <- readIORef' storage
let len0 = sizeofSmallMutableArray es0 len0 <- getSizeofSmallMutableArray es0
case size `compare` len0 of case size `compare` len0 of
GT -> error $ "size (" ++ show size ++ ") > len0 (" ++ show len0 ++ ")" GT -> error $ "size (" ++ show size ++ ") > len0 (" ++ show len0 ++ ")"
LT -> do LT -> do