Skip to content

Commit 6126638

Browse files
committed
Wasmtime 40
1 parent 2ae1a50 commit 6126638

8 files changed

Lines changed: 124 additions & 127 deletions

File tree

Cargo.lock

Lines changed: 107 additions & 113 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
wasmtime (39.0.1)
4+
wasmtime (40.0.0)
55
rb_sys (~> 0.9.124)
66

77
GEM

ext/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ magnus = { version = "0.8", features = ["rb-sys"] }
2424
rb-sys = { version = "*", default-features = false, features = [
2525
"stable-api-compiled-fallback",
2626
] }
27-
wasmtime = { version = "=39.0.1", features = ["memory-protection-keys"] }
28-
wasmtime-wasi = "=39.0.1"
27+
wasmtime = { version = "=40.0.0", features = ["memory-protection-keys"] }
28+
wasmtime-wasi = "=40.0.0"
2929
cap-std = "4.0.0"
3030
wat = "1.244.0"
3131
tokio = { version = "1.47.1", features = [
@@ -38,8 +38,8 @@ async-timer = { version = "1.0.0-beta.15", features = [
3838
"tokio1",
3939
], optional = true }
4040
static_assertions = "1.1.0"
41-
wasmtime-environ = "=39.0.1"
42-
deterministic-wasi-ctx = { version = "=3.0.4" }
41+
wasmtime-environ = "=40.0.0"
42+
deterministic-wasi-ctx = { version = "=3.0.5" }
4343

4444
[build-dependencies]
4545
rb-sys-env = "0.2.2"

ext/src/ruby_api/component.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,12 @@ impl From<ComponentImpl> for Component {
137137
let start = range.start;
138138
let end = range.end;
139139

140-
assert!(end > start);
141-
let size = unsafe { end.offset_from(start) };
140+
let size = if end > start {
141+
unsafe { end.offset_from(start) }
142+
} else {
143+
// Happens when component does not contain any Wasm functions.
144+
0
145+
};
142146

143147
Self {
144148
inner,

ext/src/ruby_api/module.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,7 @@ impl From<ModuleImpl> for Module {
142142
let size = if end > start {
143143
unsafe { end.offset_from(start) }
144144
} else {
145-
// This is mostly a safety mechanism; this should never happen if
146-
// things are correctly configured.
145+
// Happens when module does not contain any Wasm functions.
147146
0
148147
};
149148

lib/wasmtime/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module Wasmtime
4-
VERSION = "39.0.1"
4+
VERSION = "40.0.0"
55
end

spec/unit/component/component_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ module Component
5858
tmpfile = create_tmpfile(Component.new(engine, "(component)").serialize)
5959
component, increase_bytes = measure_gc_stat(:malloc_increase_bytes) { Component.deserialize_file(engine, tmpfile) }
6060

61-
expect(increase_bytes).to be > File.size(tmpfile)
61+
expect(increase_bytes).to be > 0
6262
expect(component).to be_a(Component)
6363
end
6464

@@ -80,7 +80,7 @@ def create_tmpfile(content)
8080
serialized = Component.new(engine, "(component)").serialize
8181
component, increase_bytes = measure_gc_stat(:malloc_increase_bytes) { Component.deserialize(engine, serialized) }
8282

83-
expect(increase_bytes).to be > serialized.bytesize
83+
expect(increase_bytes).to be > 0
8484
expect(component).to be_a(Wasmtime::Component::Component)
8585
end
8686
end

spec/unit/module_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ module Wasmtime
6060
tmpfile = create_tmpfile(Module.new(engine, "(module)").serialize)
6161
mod, increase_bytes = measure_gc_stat(:malloc_increase_bytes) { Module.deserialize_file(engine, tmpfile) }
6262

63-
expect(increase_bytes).to be > File.size(tmpfile)
63+
expect(increase_bytes).to be > 0
6464
expect(mod).to be_a(Wasmtime::Module)
6565
end
6666

@@ -82,7 +82,7 @@ def create_tmpfile(content)
8282
serialized = Module.new(engine, wat).serialize
8383
mod, increase_bytes = measure_gc_stat(:malloc_increase_bytes) { Module.deserialize(engine, serialized) }
8484

85-
expect(increase_bytes).to be > serialized.bytesize
85+
expect(increase_bytes).to be > 0
8686
expect(mod).to be_a(Wasmtime::Module)
8787
end
8888
end

0 commit comments

Comments
 (0)