Skip to content

MstatSectionPolicy

Namespace: Dotsider.Core.Analysis.Models

Assembly: Dotsider.Core.dll

Decides which of an mstat’s 2.1+ detail sections carry the bytes that the format double-reports into blob buckets. Every 2.x report sums frozen object, field RVA, and resource bytes into the ArrayOfFrozenObjects, FieldRvaData, and ResourceData blobs for back-compat; a reader must pick, per section, either the detail entries or the bucket blob — never both. Sharing this policy between SizeAnalyzer, MstatSizeIndex, and MstatDiffer is what keeps their totals identical.

public readonly record struct MstatSectionPolicy : IEquatable<MstatSectionPolicy>

Decides which of an mstat’s 2.1+ detail sections carry the bytes that the format double-reports into blob buckets. Every 2.x report sums frozen object, field RVA, and resource bytes into the ArrayOfFrozenObjects, FieldRvaData, and ResourceData blobs for back-compat; a reader must pick, per section, either the detail entries or the bucket blob — never both. Sharing this policy between SizeAnalyzer, MstatSizeIndex, and MstatDiffer is what keeps their totals identical.

Parameters:

  • UseFrozenObjects (Boolean): True to take frozen objects from the detail section and exclude the ArrayOfFrozenObjects blob.
  • UseRvaFields (Boolean): True to take field RVA data from the detail section and exclude the FieldRvaData blob.
  • UseManifestResources (Boolean): True to take resources from the detail section and exclude the ResourceData blob.
public MstatSectionPolicy(bool UseFrozenObjects, bool UseRvaFields, bool UseManifestResources)

True to take frozen objects from the detail section and exclude the ArrayOfFrozenObjects blob.

Returns: Boolean

public bool UseFrozenObjects { get; init; }

True to take resources from the detail section and exclude the ResourceData blob.

Returns: Boolean

public bool UseManifestResources { get; init; }

True to take field RVA data from the detail section and exclude the FieldRvaData blob.

Returns: Boolean

public bool UseRvaFields { get; init; }

The blob names this policy excludes — the buckets whose bytes are read from a detail section instead.

Returns: IReadOnlySet<String>

The excluded blob names.

public IReadOnlySet<string> ExcludedBlobNames()

The policy for reading one report on its own: each detail section is used when it has entries. A 1.x report has empty detail sections, so everything stays at blob fidelity.

Parameters:

  • data (MstatData): The report to derive the policy from.

Returns: MstatSectionPolicy

The single-report policy.

public static MstatSectionPolicy ForData(MstatData data)

The policy for comparing two reports, applied to both sides so the same bytes land in the same section everywhere. A detail section is used only when every non-empty side understands it (format 2.1+) and at least one side has entries; otherwise both sides degrade to blob fidelity for that section, which loses no bytes because 2.x double-reports them. Empty (format 0.0) is transparent: it constrains nothing.

Parameters:

Returns: MstatSectionPolicy

The shared policy for both sides.

public static MstatSectionPolicy ForPair(MstatData left, MstatData right)