summaryrefslogtreecommitdiff
path: root/android/module.go
diff options
context:
space:
mode:
author Android Build Coastguard Worker <android-build-coastguard-worker@google.com> 2025-03-21 20:05:43 -0700
committer Android Build Coastguard Worker <android-build-coastguard-worker@google.com> 2025-03-21 20:05:43 -0700
commit1248ced0cad29018090e65e3762585cdd774e864 (patch)
tree2789f57ad33c7bf8a28df9ded872139adcf05ac7 /android/module.go
parent29e0a00b2a9010b7b30f004fb9f6a2ad7ea20bcb (diff)
parent716fc3438bce5e2018b47cf906195b4f9aecea5c (diff)
Snap for 13256841 from 716fc3438bce5e2018b47cf906195b4f9aecea5c to 25Q2-release
Change-Id: I4c3a8288d87d662237450f7cb929abe4669668ca
Diffstat (limited to 'android/module.go')
-rw-r--r--android/module.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/android/module.go b/android/module.go
index ecd0f239c..c0abfd0a3 100644
--- a/android/module.go
+++ b/android/module.go
@@ -45,6 +45,14 @@ type Module interface {
// For more information, see Module.GenerateBuildActions within Blueprint's module_ctx.go
GenerateAndroidBuildActions(ModuleContext)
+ // CleanupAfterBuildActions is called after ModuleBase.GenerateBuildActions is finished.
+ // If all interactions with this module are handled via providers instead of direct access
+ // to the module then it can free memory attached to the module.
+ // This is a temporary measure to reduce memory usage, eventually blueprint's reference
+ // to the Module should be dropped after GenerateAndroidBuildActions once all accesses
+ // can be done through providers.
+ CleanupAfterBuildActions()
+
// Add dependencies to the components of a module, i.e. modules that are created
// by the module and which are considered to be part of the creating module.
//
@@ -2387,8 +2395,12 @@ func (m *ModuleBase) GenerateBuildActions(blueprintCtx blueprint.ModuleContext)
})
}
}
+
+ m.module.CleanupAfterBuildActions()
}
+func (m *ModuleBase) CleanupAfterBuildActions() {}
+
func SetJarJarPrefixHandler(handler func(ModuleContext)) {
if jarJarPrefixHandler != nil {
panic("jarJarPrefixHandler already set")