diff --git a/src/Memory.cs b/src/Memory.cs index a3d1a7ea..ac2e748e 100644 --- a/src/Memory.cs +++ b/src/Memory.cs @@ -146,30 +146,6 @@ public unsafe IntPtr GetPointer() return (nint)data; } - /// - /// Gets the span of the memory. - /// - /// Returns the span of the memory. - /// The memory has more than 32767 pages. - /// - /// - /// The span may become invalid if the memory grows. - /// - /// This may happen if the memory is explicitly requested to grow or - /// grows as a result of WebAssembly execution. - /// - /// - /// Therefore, the returned span should not be used after calling the grow method or - /// after calling into WebAssembly code. - /// - /// - [Obsolete("This method will throw an OverflowException if the memory has more than 32767 pages. " + - "Use the " + nameof(GetSpan) + " overload taking an address and a length.")] - public Span GetSpan() - { - return GetSpan(0, checked((int)GetLength())); - } - /// /// Gets a span of a section of the memory. /// diff --git a/src/Table.cs b/src/Table.cs index 24716219..7a6a74ec 100644 --- a/src/Table.cs +++ b/src/Table.cs @@ -25,20 +25,6 @@ public enum TableKind /// public class Table : IExternal { - /// - /// Creates a new WebAssembly table. - /// - /// The store to create the table in. - /// The value kind for the elements in the table. - /// The initial value for elements in the table. - /// The number of initial elements in the table. - /// The maximum number of elements in the table. - [Obsolete("Replace ValueKind parameter with TableKind")] - public Table(Store store, ValueKind kind, object? initialValue, uint initial, uint maximum = uint.MaxValue) - : this(store, (TableKind)kind, initialValue, initial, maximum) - { - } - /// /// Creates a new WebAssembly table. /// diff --git a/tests/Memory64AccessTests.cs b/tests/Memory64AccessTests.cs index 86a5bbb1..4b874769 100644 --- a/tests/Memory64AccessTests.cs +++ b/tests/Memory64AccessTests.cs @@ -34,7 +34,7 @@ public unsafe void ItCanAccessMemoryWith65537Pages() memoryExport.Is64Bit.Should().BeTrue(); var instance = Linker.Instantiate(Store, Fixture.Module); - var memory = instance.GetMemory("mem"); + var memory = instance.GetMemory("mem")!; memory.Minimum.Should().Be(0x10001); memory.Maximum.Should().Be(0x1000000000000); @@ -75,14 +75,9 @@ public unsafe void ItCanAccessMemoryWith65537Pages() public void ItThrowsForOutOfBoundsAccess() { var instance = Linker.Instantiate(Store, Fixture.Module); - var memory = instance.GetMemory("mem"); + var memory = instance.GetMemory("mem")!; -#pragma warning disable CS0618 // Type or member is obsolete - Action action = () => memory.GetSpan(); -#pragma warning restore CS0618 // Type or member is obsolete - action.Should().Throw(); - - action = () => memory.GetSpan(0x10000); + Action action = () => memory.GetSpan(0x10000); action.Should().Throw(); action = () => memory.GetSpan(-1L, 0); diff --git a/tests/MemoryAccessTests.cs b/tests/MemoryAccessTests.cs index b30bbb88..fe9a7e4d 100644 --- a/tests/MemoryAccessTests.cs +++ b/tests/MemoryAccessTests.cs @@ -67,7 +67,7 @@ public unsafe void ItCanAccessMemoryWith65536Pages() memoryExport.Is64Bit.Should().BeFalse(); var instance = Linker.Instantiate(Store, Fixture.Module); - var memory = instance.GetMemory("mem"); + var memory = instance.GetMemory("mem")!; memory.Minimum.Should().Be(0x10000); memory.Maximum.Should().BeNull(); @@ -108,14 +108,9 @@ public unsafe void ItCanAccessMemoryWith65536Pages() public void ItThrowsForOutOfBoundsAccess() { var instance = Linker.Instantiate(Store, Fixture.Module); - var memory = instance.GetMemory("mem"); + var memory = instance.GetMemory("mem")!; -#pragma warning disable CS0618 // Type or member is obsolete - Action action = () => memory.GetSpan(); -#pragma warning restore CS0618 // Type or member is obsolete - action.Should().Throw(); - - action = () => memory.GetSpan(0); + Action action = () => memory.GetSpan(0); action.Should().Throw(); action = () => memory.GetSpan(-1L, 0);