/// <summary> /// Returns whether this memory range contains all of <paramref name="other"/>. /// </summary> /// <param name="other">The other memory range to compare this to.</param> /// <returns>True if this memory range completely encloses <paramref name="other"/>.</returns> public bool Contains(MemoryRange other) => other.Length > 0 && (Contains(other.Start) && Contains(other.End - 1));
/// <summary> /// Returns whether this memory range and <paramref name="other"/> contains any addresses which /// overlap. /// </summary> /// <param name="other">The other memory range to compare this to.</param> /// <returns>True if memory ranges overlap at all.</returns> public bool Overlaps(MemoryRange other) => other.Length > 0 && (Contains(other.Start) || Contains(other.End - 1));