Use struct{}

Using struct{}{} as the payload for set maps reduces memory use for
large sets.

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Test: m systemlicense
Test: m listshare; out/soong/host/linux-x86/bin/listshare ...
Test: m checkshare; out/soong/host/linux-x86/bin/checkshare ...
Test: m dumpgraph; out/soong/host/linux-x86/dumpgraph ...
Test: m dumpresolutions; out/soong/host/linux-x86/dumpresolutions ...

where ... is the path to the .meta_lic file for the system image. In my
case if

$ export PRODUCT=$(realpath $ANDROID_PRODUCT_OUT --relative-to=$PWD)

... can be expressed as:

${PRODUCT}/gen/META/lic_intermediates/${PRODUCT}/system.img.meta_lic

Change-Id: Ibc831ae80fc50f35e1000348fb28fc0167d0ebed
This commit is contained in:
Bob Badour
2022-01-10 18:44:59 -08:00
parent 67d8ae390a
commit 5446a6f8e1
6 changed files with 29 additions and 29 deletions

View File

@@ -191,7 +191,7 @@ func addDependencies(edges *[]*dependencyEdge, target string, dependencies []*li
// look up a common constant annotation string from a small map
// instead of creating 1000's of copies of the same 3 strings.
if ann, ok := RecognizedAnnotations[a]; ok {
annotations.annotations[ann] = true
annotations.annotations[ann] = struct{}{}
}
}
*edges = append(*edges, &dependencyEdge{target, dependency, annotations})