[Git][ghc/ghc][wip/fendor/linkable-usage] WIP: force fingerprint to avoid retaining CompiledByteCode objects
Hannes Siebenhandl pushed to branch wip/fendor/linkable-usage at Glasgow Haskell Compiler / GHC Commits: 88863e7f by fendor at 2026-02-12T10:07:01+01:00 WIP: force fingerprint to avoid retaining CompiledByteCode objects - - - - - 2 changed files: - compiler/GHC/Driver/Main.hs - compiler/GHC/Linker/Types.hs Changes: ===================================== compiler/GHC/Driver/Main.hs ===================================== @@ -2246,7 +2246,7 @@ mkModuleByteCode :: HscEnv -> Module -> ModLocation -> CgInteractiveGuts -> IO M mkModuleByteCode hsc_env mod mod_location cgguts = do bcos <- hscGenerateByteCode hsc_env cgguts mod_location objs <- outputAndCompileForeign hsc_env mod mod_location (cgi_foreign_files cgguts) (cgi_foreign cgguts) - bcos_hash <- fingerprintModuleByteCodeContents mod bcos objs + !bcos_hash <- fingerprintModuleByteCodeContents mod bcos objs return $! ModuleByteCode mod bcos objs bcos_hash -- | Generate a fresh 'ModuleByteCode' for a given module but do not write it to disk. @@ -2861,7 +2861,7 @@ hscCompileCoreExpr' hsc_env srcspan ds_expr = do {- load it -} bco_time <- getCurrentTime - bco_hash <- fingerprintModuleByteCodeContents this_mod bcos [] + !bco_hash <- fingerprintModuleByteCodeContents this_mod bcos [] let mbc = ModuleByteCode this_mod bcos [] bco_hash (mods_needed, units_needed) <- loadDecls interp hsc_env srcspan $ Linkable bco_time this_mod $ NE.singleton (DotGBC mbc) ===================================== compiler/GHC/Linker/Types.hs ===================================== @@ -457,7 +457,7 @@ data LinkablePart data ModuleByteCode = ModuleByteCode { gbc_module :: Module , gbc_compiled_byte_code :: CompiledByteCode , gbc_foreign_files :: [FilePath] -- ^ Path to object files - , gbc_hash :: Fingerprint + , gbc_hash :: !Fingerprint } mkModuleByteCodeLinkable :: UTCTime -> ModuleByteCode -> Linkable View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/88863e7fc8022ef334542ccb572f2611... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/88863e7fc8022ef334542ccb572f2611... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Hannes Siebenhandl (@fendor)