wardite 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Makefile +9 -1
- data/README.md +36 -4
- data/benchmark/count_ruby_wasm_functions.rb +37 -0
- data/benchmark/measure_mir_cache_restore.rb +59 -0
- data/benchmark/results/efflorescence-mir2-function-restore.json +480 -0
- data/docs/adr/0009-efflorescence-mir2-cache-integrity-modes.md +1 -1
- data/docs/adr/0010-efflorescence-mir2-cache-function-restore.md +1 -1
- data/docs/efflorescence-mir2-cache.md +31 -2
- data/docs/efflorescence-spinel-linear-memory.md +6 -4
- data/lib/wardite/cli/cli.rb +3 -1
- data/lib/wardite/efflorescence/ir.rb +12 -3
- data/lib/wardite/efflorescence/mir_cache.rb +165 -73
- data/lib/wardite/efflorescence/snapshot.rb +5 -2
- data/lib/wardite/efflorescence/vm.rb +4 -3
- data/lib/wardite/load.rb +3 -2
- data/lib/wardite/version.rb +1 -1
- data/lib/wardite.rb +1 -1
- data/scripts/build_spinel_zig.rb +121 -0
- data/sig/generated/wardite/efflorescence/ir.rbs +5 -2
- data/sig/generated/wardite/efflorescence/mir_cache.rbs +41 -14
- data/sig/generated/wardite/efflorescence/snapshot.rbs +2 -1
- data/sig/generated/wardite/load.rbs +2 -1
- data/sig/io_buffer.rbs +7 -0
- metadata +6 -3
- data/spinel/patches/0001-io-buffer-string-view.patch +0 -699
- data/spinel/patches/0002-io-buffer-allocation-error.patch +0 -47
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
From a9a35b85d75ca273558f7e25a875cc240fc0f5a3 Mon Sep 17 00:00:00 2001
|
|
2
|
-
From: Uchio Kondo <udzura@udzura.jp>
|
|
3
|
-
Date: Thu, 12 Nov 2026 00:57:15 +0900
|
|
4
|
-
Subject: [PATCH] Raise ENOMEM when IO::Buffer allocation fails
|
|
5
|
-
|
|
6
|
-
Let callers preserve the previous buffer when a replacement cannot be allocated.
|
|
7
|
-
|
|
8
|
-
Co-authored-by: Codex <codex@openai.com>
|
|
9
|
-
---
|
|
10
|
-
lib/sp_iobuffer.c | 2 +-
|
|
11
|
-
test/io_buffer_allocation_error.rb | 5 +++++
|
|
12
|
-
test/io_buffer_allocation_error.rb.expected | 1 +
|
|
13
|
-
3 files changed, 7 insertions(+), 1 deletion(-)
|
|
14
|
-
create mode 100644 test/io_buffer_allocation_error.rb
|
|
15
|
-
create mode 100644 test/io_buffer_allocation_error.rb.expected
|
|
16
|
-
|
|
17
|
-
diff --git a/lib/sp_iobuffer.c b/lib/sp_iobuffer.c
|
|
18
|
-
index 3cdf111aa..922ea783b 100644
|
|
19
|
-
--- a/lib/sp_iobuffer.c
|
|
20
|
-
+++ b/lib/sp_iobuffer.c
|
|
21
|
-
@@ -377,7 +377,7 @@ static void iob_allocate(sp_IOBuffer *b, int64_t size, uint32_t flags, int flags
|
|
22
|
-
b->size = size;
|
|
23
|
-
if (size > 0) {
|
|
24
|
-
b->data = (uint8_t *)calloc(1, (size_t)size);
|
|
25
|
-
- if (!b->data) sp_oom_die();
|
|
26
|
-
+ if (!b->data) sp_raise_cls("Errno::ENOMEM", "Cannot allocate memory");
|
|
27
|
-
sp_gc_payload_resize(b, 0, (size_t)size);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
diff --git a/test/io_buffer_allocation_error.rb b/test/io_buffer_allocation_error.rb
|
|
31
|
-
new file mode 100644
|
|
32
|
-
index 000000000..e9ce7a488
|
|
33
|
-
--- /dev/null
|
|
34
|
-
+++ b/test/io_buffer_allocation_error.rb
|
|
35
|
-
@@ -0,0 +1,5 @@
|
|
36
|
-
+begin
|
|
37
|
-
+ IO::Buffer.new((1 << 62) - 1)
|
|
38
|
-
+rescue Errno::ENOMEM => error
|
|
39
|
-
+ puts error.class
|
|
40
|
-
+end
|
|
41
|
-
diff --git a/test/io_buffer_allocation_error.rb.expected b/test/io_buffer_allocation_error.rb.expected
|
|
42
|
-
new file mode 100644
|
|
43
|
-
index 000000000..cb4d39d44
|
|
44
|
-
--- /dev/null
|
|
45
|
-
+++ b/test/io_buffer_allocation_error.rb.expected
|
|
46
|
-
@@ -0,0 +1 @@
|
|
47
|
-
+Errno::ENOMEM
|