basic_packing

Function basic_packing 

Source
fn basic_packing<'a>(
    components: &'a [ObjectSourceMetaSized],
    bin_size: NonZeroU32,
    prior_build_metadata: Option<&ImageManifest>,
) -> Result<Vec<Vec<&'a ObjectSourceMetaSized>>>
Expand description

Given a set of components with size metadata (e.g. boxes of a certain size) and a number of bins (possible container layers) to use, determine which components go in which bin. This algorithm is pretty simple: Total available bins = n

1 bin for all the u32_max frequency pkgs 1 bin for all newly added pkgs 1 bin for all low size pkgs

60% of n-3 bins for high size pkgs 40% of n-3 bins for medium size pkgs

If HS bins > limit, spillover to MS to package If MS bins > limit, fold by merging 2 bins from the end