Skip to content

Commit

Permalink
Update for the changes in bytecodealliance/wasmtime#9206 for implemen…
Browse files Browse the repository at this point in the history
…ting the table64 extension.
  • Loading branch information
kpreisser committed Sep 24, 2024
1 parent 9a64e14 commit 5fc9781
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Table.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public Table(Store store, TableKind kind, object? initialValue, uint initial, ui
/// </summary>
/// <param name="index">The index in the table to get the element of.</param>
/// <returns>Returns the table element.</returns>
public object? GetElement(uint index)
public object? GetElement(ulong index)
{
var context = store.Context;
if (!Native.wasmtime_table_get(context.handle, this.table, index, out var v))
Expand All @@ -143,7 +143,7 @@ public Table(Store store, TableKind kind, object? initialValue, uint initial, ui
/// </summary>
/// <param name="index">The index in the table to set the element of.</param>
/// <param name="value">The value to set.</param>
public void SetElement(uint index, object? value)
public void SetElement(ulong index, object? value)
{
var v = Value.FromObject(store, value, Kind);

Expand All @@ -167,7 +167,7 @@ public void SetElement(uint index, object? value)
/// Gets the current size of the table.
/// </summary>
/// <value>Returns the current size of the table.</value>
public uint GetSize()
public ulong GetSize()
{
var result = Native.wasmtime_table_size(store.Context.handle, this.table);
GC.KeepAlive(store);
Expand All @@ -180,7 +180,7 @@ public uint GetSize()
/// <param name="delta">The number of elements to grow the table.</param>
/// <param name="initialValue">The initial value for the new elements.</param>
/// <returns>Returns the previous number of elements in the table.</returns>
public uint Grow(uint delta, object? initialValue)
public ulong Grow(ulong delta, object? initialValue)
{
var v = Value.FromObject(store, initialValue, Kind);

Expand Down Expand Up @@ -261,16 +261,16 @@ internal struct Limits

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

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

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

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

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

0 comments on commit 5fc9781

Please sign in to comment.