bytecodealliance / wasmtime-dotnet

.NET embedding of Wasmtime https://bytecodealliance.github.io/wasmtime-dotnet/
Apache License 2.0
409 stars 52 forks source link

Update to the new fuel APIs #281

Closed kpreisser closed 10 months ago

kpreisser commented 10 months ago

Update to the new fuel APIs introduced in bytecodealliance/wasmtime#7298.

I switched to a property so that it's possible e.g. to add or consume fuel with code like this:

store.Fuel += 100;

// Consume fuel, throwing an OverflowException if too little fuel is available.
checked {
    store.Fuel -= 150;
}

What do you think? Thanks!