Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b1d8c99e authored by Colin Cross's avatar Colin Cross
Browse files

Pass desired size proptools.FilterPropertyStructSharded

proptools.FilterPropertyStructSharded now takes a desired max size
of the name.

Fixes: 146234651
Test: all soong tests
Change-Id: Ifa10039e5f55a5d0f4a35172983d43f33af88e93
parent b4fecbfe
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -938,7 +938,14 @@ type archPropRoot struct {
// returns lists of reflect.Types that contains the arch-variant properties inside structs for each
// arch, multilib and target property.
func createArchPropTypeDesc(props reflect.Type) []archPropTypeDesc {
	propShards, _ := proptools.FilterPropertyStructSharded(props, filterArchStruct)
	// Each property struct shard will be nested many times under the runtime generated arch struct,
	// which can hit the limit of 64kB for the name of runtime generated structs.  They are nested
	// 97 times now, which may grow in the future, plus there is some overhead for the containing
	// type.  This number may need to be reduced if too many are added, but reducing it too far
	// could cause problems if a single deeply nested property no longer fits in the name.
	const maxArchTypeNameSize = 500

	propShards, _ := proptools.FilterPropertyStructSharded(props, maxArchTypeNameSize, filterArchStruct)
	if len(propShards) == 0 {
		return nil
	}