@@ -22,10 +22,10 @@ internal unsafe struct ValueRaw
22
22
public V128 v128 ;
23
23
24
24
[ FieldOffset ( 0 ) ]
25
- public nuint funcref ;
25
+ public IntPtr funcref ;
26
26
27
27
[ FieldOffset ( 0 ) ]
28
- public nuint externref ;
28
+ public IntPtr externref ;
29
29
30
30
public static IValueRawConverter < T > Converter < T > ( )
31
31
{
@@ -196,7 +196,7 @@ public Function Unbox(StoreContext storeContext, Store store, in ValueRaw valueR
196
196
{
197
197
var funcref = default ( ExternFunc ) ;
198
198
199
- if ( valueRaw . funcref != 0 )
199
+ if ( valueRaw . funcref != IntPtr . Zero )
200
200
{
201
201
Function . Native . wasmtime_func_from_raw ( storeContext . handle , valueRaw . funcref , out funcref ) ;
202
202
}
@@ -206,7 +206,7 @@ public Function Unbox(StoreContext storeContext, Store store, in ValueRaw valueR
206
206
207
207
public void Box ( StoreContext storeContext , Store store , ref ValueRaw valueRaw , Function ? value )
208
208
{
209
- nuint funcrefInt = 0 ;
209
+ IntPtr funcrefPtr = IntPtr . Zero ;
210
210
211
211
if ( value ? . IsNull is false )
212
212
{
@@ -219,10 +219,10 @@ public void Box(StoreContext storeContext, Store store, ref ValueRaw valueRaw, F
219
219
throw new InvalidOperationException ( "Returning a Function is only allowed when it belongs to the current store." ) ;
220
220
}
221
221
222
- funcrefInt = Function . Native . wasmtime_func_to_raw ( storeContext . handle , value . func ) ;
222
+ funcrefPtr = Function . Native . wasmtime_func_to_raw ( storeContext . handle , value . func ) ;
223
223
}
224
224
225
- valueRaw . funcref = funcrefInt ;
225
+ valueRaw . funcref = funcrefPtr ;
226
226
}
227
227
}
228
228
@@ -238,7 +238,7 @@ private GenericValueRawConverter()
238
238
{
239
239
object ? o = null ;
240
240
241
- if ( valueRaw . externref != 0 )
241
+ if ( valueRaw . externref != IntPtr . Zero )
242
242
{
243
243
// The externref is an owned value, so we must delete it afterwards.
244
244
var externref = Value . Native . wasmtime_externref_from_raw ( storeContext . handle , valueRaw . externref ) ;
@@ -262,7 +262,7 @@ private GenericValueRawConverter()
262
262
263
263
public void Box ( StoreContext storeContext , Store store , ref ValueRaw valueRaw , T value )
264
264
{
265
- nuint externrefInt = 0 ;
265
+ IntPtr externrefPtr = IntPtr . Zero ;
266
266
267
267
if ( value is not null )
268
268
{
@@ -276,7 +276,7 @@ public void Box(StoreContext storeContext, Store store, ref ValueRaw valueRaw, T
276
276
// Note: The externref data isn't tracked by wasmtime's GC until
277
277
// it enters WebAssembly, so Store.GC() mustn't be called between
278
278
// converting the value and passing it to WebAssembly.
279
- externrefInt = Value . Native . wasmtime_externref_to_raw ( storeContext . handle , externref ) ;
279
+ externrefPtr = Value . Native . wasmtime_externref_to_raw ( storeContext . handle , externref ) ;
280
280
}
281
281
finally
282
282
{
@@ -286,7 +286,7 @@ public void Box(StoreContext storeContext, Store store, ref ValueRaw valueRaw, T
286
286
}
287
287
}
288
288
289
- valueRaw . externref = externrefInt ;
289
+ valueRaw . externref = externrefPtr ;
290
290
}
291
291
}
292
292
}
0 commit comments