From 36d29937a5dee2e4808b1f57baa76bc6d9599fd4 Mon Sep 17 00:00:00 2001 From: bkchr Date: Mon, 26 May 2025 01:17:52 +0000 Subject: [PATCH] deploy: 91b31618c487c7c8d5e790a244c2e39be2a7c86c --- print.html | 40 ++++++++++--------- ...45-remove-unnecessary-allocator-usage.html | 40 ++++++++++--------- searchindex.js | 2 +- searchindex.json | 2 +- 4 files changed, 46 insertions(+), 38 deletions(-) diff --git a/print.html b/print.html index 55e6522..c262fb0 100644 --- a/print.html +++ b/print.html @@ -683,6 +683,10 @@ of the paras, the locked/unlocked state, and the manager info.

@@ -705,13 +709,13 @@ of the paras, the locked/unlocked state, and the manager info.

The signature and behaviour of ext_storage_read_version_2 and ext_default_child_storage_read_version_2 are identical to their version 1 counterparts, but the return value has a different meaning.

The new functions directly return the number of bytes written into the value_out buffer. If the entry doesn't exist, -1 is returned. Given that the host must never write more bytes than the size of the buffer in value_out, and that the size of this buffer is expressed as a 32-bit number, the 64-bit value of -1 is not ambiguous.

(func $ext_storage_next_key_version_2
-    (param $key i64) (param $out i64) (return i32))
+    (param $key_in_out i64) (return i32))
 (func $ext_default_child_storage_next_key_version_2
-    (param $child_storage_key i64) (param $key i64) (param $out i64) (return i32))
+    (param $child_storage_key i64) (param $key_in_out i64) (return i32))
 

The behaviour of these functions is identical to their version 1 counterparts.

-

Instead of allocating a buffer, writing the next key to it, and returning a pointer to it, the new version of these functions accepts an out parameter containing a pointer-size to the memory location where the host writes the output.

-

These functions return the size, in bytes, of the next key, or 0 if there is no next key. If the size of the next key is larger than the buffer in out, the bytes of the key that fit the buffer are written to out, and any extra bytes that don't fit are discarded.

+

Instead of allocating a buffer, writing the next key to it, and returning a pointer to it, the new version of these functions accepts an key_in_out parameter containing a pointer-size to the memory location where the host first reads the input from, and then writes the output to.

+

These functions return the size, in bytes, of the next key, or 0 if there is no next key. If the size of the next key is larger than the buffer in key_in_out, the bytes of the key that fit the buffer are written to key_in_out, and any extra bytes that don't fit are discarded.

Some notes: