From a81c92dc2cdff02c55fdc197d943bc7a35c64be5 Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Tue, 7 May 2024 14:21:13 -0400 Subject: fig-emulator-gb: Fix space leak --- fig-emulator-gb/src/Fig/Emulator/GB/Component/RAM.hs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'fig-emulator-gb/src/Fig/Emulator/GB/Component/RAM.hs') diff --git a/fig-emulator-gb/src/Fig/Emulator/GB/Component/RAM.hs b/fig-emulator-gb/src/Fig/Emulator/GB/Component/RAM.hs index e20dd8d..b17292c 100644 --- a/fig-emulator-gb/src/Fig/Emulator/GB/Component/RAM.hs +++ b/fig-emulator-gb/src/Fig/Emulator/GB/Component/RAM.hs @@ -3,7 +3,6 @@ module Fig.Emulator.GB.Component.RAM ) where import Fig.Prelude -import Prelude (fromIntegral) import qualified Data.Vector as V import qualified Data.Vector.Mutable as MV @@ -25,11 +24,11 @@ compWRAM start size = Component { compState = V.replicate size 0 :: V.Vector Word8 , compMatches = \a -> a >= start && a <= end - , compUpdate = \s _ -> pure s - , compWrite = \s ad v -> do + , compUpdate = \s _ -> {-# SCC "ComponentWRAMUpdate" #-} pure s + , compWrite = \s ad v -> {-# SCC "ComponentWRAMWrite" #-} do let offset = fromIntegral . unAddr $ ad - start pure $ V.modify (\ms -> MV.write ms offset v) s - , compRead = \s ad -> do + , compRead = \s ad -> {-# SCC "ComponentWRAMRead" #-} do let offset = fromIntegral . unAddr $ ad - start case s V.!? offset of Nothing -> throwM . RAMError $ mconcat -- cgit v1.2.3