Skip to content

Commit 603ef95

Browse files
Bas Geertsemajsturtevant
authored andcommitted
Update to 26.0.1
In Table.cs changes 32 bit indices (uint) to 64 bit changes (ulong). This has been changed in the C-api because of bytecodealliance/wasmtime#9206. All tests pass
1 parent e707725 commit 603ef95

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22
<PropertyGroup>
33
<DevBuild Condition="'$(DevBuild)'==''">false</DevBuild>
4-
<WasmtimeVersion Condition="'$(WasmtimeVersion)'==''">25.0.3</WasmtimeVersion>
4+
<WasmtimeVersion Condition="'$(WasmtimeVersion)'==''">26.0.1</WasmtimeVersion>
55
<WasmtimeDotnetVersion Condition="'$(WasmtimeDotnetVersion)'==''"></WasmtimeDotnetVersion>
66
<WasmtimePackageVersion Condition="'$(DevBuild)'=='true'">
77
$(WasmtimeVersion)$(WasmtimeDotnetVersion)-dev</WasmtimePackageVersion>

src/Table.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -147,17 +147,17 @@ public void SetElement(uint index, object? value)
147147
{
148148
var v = Value.FromObject(store, value, Kind);
149149

150-
try
150+
try
151151
{
152152
var error = Native.wasmtime_table_set(store.Context.handle, this.table, index, v);
153-
GC.KeepAlive(store);
153+
GC.KeepAlive(store);
154154

155155
if (error != IntPtr.Zero)
156156
{
157157
throw WasmtimeException.FromOwnedError(error);
158158
}
159159
}
160-
finally
160+
finally
161161
{
162162
v.Release(store);
163163
}
@@ -167,7 +167,7 @@ public void SetElement(uint index, object? value)
167167
/// Gets the current size of the table.
168168
/// </summary>
169169
/// <value>Returns the current size of the table.</value>
170-
public uint GetSize()
170+
public ulong GetSize()
171171
{
172172
var result = Native.wasmtime_table_size(store.Context.handle, this.table);
173173
GC.KeepAlive(store);
@@ -180,14 +180,14 @@ public uint GetSize()
180180
/// <param name="delta">The number of elements to grow the table.</param>
181181
/// <param name="initialValue">The initial value for the new elements.</param>
182182
/// <returns>Returns the previous number of elements in the table.</returns>
183-
public uint Grow(uint delta, object? initialValue)
183+
public ulong Grow(uint delta, object? initialValue)
184184
{
185185
var v = Value.FromObject(store, initialValue, Kind);
186186

187187
try
188188
{
189189
var error = Native.wasmtime_table_grow(store.Context.handle, this.table, delta, v, out var prev);
190-
GC.KeepAlive(store);
190+
GC.KeepAlive(store);
191191

192192
if (error != IntPtr.Zero)
193193
{
@@ -261,16 +261,16 @@ internal struct Limits
261261

262262
[DllImport(Engine.LibraryName)]
263263
[return: MarshalAs(UnmanagedType.I1)]
264-
public static extern bool wasmtime_table_get(IntPtr context, in ExternTable table, uint index, out Value val);
264+
public static extern bool wasmtime_table_get(IntPtr context, in ExternTable table, ulong index, out Value val);
265265

266266
[DllImport(Engine.LibraryName)]
267-
public static extern IntPtr wasmtime_table_set(IntPtr context, in ExternTable table, uint index, in Value val);
267+
public static extern IntPtr wasmtime_table_set(IntPtr context, in ExternTable table, ulong index, in Value val);
268268

269269
[DllImport(Engine.LibraryName)]
270-
public static extern uint wasmtime_table_size(IntPtr context, in ExternTable table);
270+
public static extern ulong wasmtime_table_size(IntPtr context, in ExternTable table);
271271

272272
[DllImport(Engine.LibraryName)]
273-
public static extern IntPtr wasmtime_table_grow(IntPtr context, in ExternTable table, uint delta, in Value value, out uint prev);
273+
public static extern IntPtr wasmtime_table_grow(IntPtr context, in ExternTable table, ulong delta, in Value value, out ulong prev);
274274

275275
[DllImport(Engine.LibraryName)]
276276
public static extern IntPtr wasmtime_table_type(IntPtr context, in ExternTable table);

0 commit comments

Comments
 (0)