diff options
author | vnugent <public@vaughnnugent.com> | 2023-03-11 00:57:31 -0500 |
---|---|---|
committer | vnugent <public@vaughnnugent.com> | 2023-03-11 00:57:31 -0500 |
commit | ee7a6272742ce9b50e5b3f0dfc2f2623f36e9057 (patch) | |
tree | b5481f6b55064325d5f504f568e615fda574b9a5 /lib/Utils | |
parent | 606e9b3331e73d68da38ec8139051ee1d0149061 (diff) |
Data buffer patch
Diffstat (limited to 'lib/Utils')
-rw-r--r-- | lib/Utils/src/Memory/Diagnostics/HeapStatistics.cs | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/lib/Utils/src/Memory/Diagnostics/HeapStatistics.cs b/lib/Utils/src/Memory/Diagnostics/HeapStatistics.cs index ec9fe0c..5d7d3f1 100644 --- a/lib/Utils/src/Memory/Diagnostics/HeapStatistics.cs +++ b/lib/Utils/src/Memory/Diagnostics/HeapStatistics.cs @@ -1,5 +1,5 @@ /* -* Copyright (c) 2022 Vaughn Nugent +* Copyright (c) 2023 Vaughn Nugent * * Library: VNLib * Package: VNLib.Utils @@ -22,15 +22,13 @@ * along with VNLib.Utils. If not, see http://www.gnu.org/licenses/. */ -using System; - namespace VNLib.Utils.Memory.Diagnostics { /// <summary> /// A structures that represents the current/last captures /// statistics of the monitored heap /// </summary> - public readonly struct HeapStatistics : IEquatable<HeapStatistics> + public readonly record struct HeapStatistics { /// <summary> /// The current size (in bytes) of the heap @@ -52,25 +50,5 @@ namespace VNLib.Utils.Memory.Diagnostics /// The number of allocated handles/blocks /// </summary> public readonly ulong AllocatedBlocks { get; init; } - - ///<inheritdoc/> - public override bool Equals(object? obj) => obj is HeapStatistics s && Equals(s); - - ///<inheritdoc/> - public override int GetHashCode() => (int)((AllocatedBytes ^ MaxBlockSize) & int.MaxValue); - - ///<inheritdoc/> - public static bool operator ==(HeapStatistics left, HeapStatistics right) => left.Equals(right); - ///<inheritdoc/> - public static bool operator !=(HeapStatistics left, HeapStatistics right) => !(left == right); - - ///<inheritdoc/> - public bool Equals(HeapStatistics other) - { - return MinBlockSize == other.MinBlockSize - && MaxBlockSize == other.MaxBlockSize - && MaxHeapSize == other.MaxHeapSize - && AllocatedBytes == other.AllocatedBytes; - } } } |