diff options
author | 2025-03-21 14:37:59 -0700 | |
---|---|---|
committer | 2025-03-21 14:37:59 -0700 | |
commit | 07638f131eafac3cf915cbeb5d1003037347c41d (patch) | |
tree | 664036fa2d5620262b3260c1b78fcdcc95a1b993 /cc | |
parent | 8b391cba7fbe102dce869f71c97f0954bf61d4b5 (diff) | |
parent | b790b9cb8f891bf21755ccc97a5405b2ed0687d2 (diff) |
Merge "Clear as much of cc.Module as possible after GenerateBuildActions" into main
Diffstat (limited to 'cc')
-rw-r--r-- | cc/cc.go | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -2438,6 +2438,27 @@ func (c *Module) GenerateAndroidBuildActions(actx android.ModuleContext) { } } +func (c *Module) CleanupAfterBuildActions() { + // Clear as much of Module as possible to reduce memory usage. + c.generators = nil + c.compiler = nil + c.installer = nil + c.features = nil + c.coverage = nil + c.fuzzer = nil + c.sabi = nil + c.lto = nil + c.afdo = nil + c.orderfile = nil + + // TODO: these can be cleared after nativeBinaryInfoProperties and nativeLibInfoProperties are switched to + // using providers. + // c.linker = nil + // c.stl = nil + // c.sanitize = nil + // c.library = nil +} + func CreateCommonLinkableInfo(ctx android.ModuleContext, mod VersionedLinkableInterface) *LinkableInfo { info := &LinkableInfo{ StaticExecutable: mod.StaticExecutable(), |