Skip to content

Commit 322c1ba

Browse files
note on buffer size
1 parent 97d6301 commit 322c1ba

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

design/mvp/CanonicalABI.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1336,8 +1336,9 @@ that returns how many `t` values may still be read or written. Buffers mostly
13361336
hide their original/complete size. However, zero-length buffers need to be
13371337
treated specially (particularly when a zero-length read rendezvous with a
13381338
zero-length write), so there is a special query for detecting whether a buffer
1339-
is zero-length. Based on this, buffers are represented by the following 3
1340-
abstract Python classes:
1339+
is zero-length. Internally, buffers do have a maximum length of `2^28 - 1` which
1340+
is independent of the type of memory backing the buffer. Based on this, buffers
1341+
are represented by the following 3 abstract Python classes:
13411342
```python
13421343
class Buffer:
13431344
MAX_LENGTH = 2**28 - 1
@@ -4270,7 +4271,9 @@ the other end dropped, calling anything other than `stream.drop-*` traps.
42704271
Lastly, `stream_event` packs the `CopyResult` and number of elements copied up
42714272
until this point into a single `i32` or `i64`-sized payload for core wasm. The
42724273
size is determined by the `addrtype` coming from the [`memory type`] of the
4273-
`memory` immediate.
4274+
`memory` immediate. Note that even though the number of elements copied is
4275+
packed into an `addrtype`, the maximum length of the buffer is fixed at `2^28 - 1`
4276+
independently of the `addrtype`.
42744277
```python
42754278
def stream_event(result, reclaim_buffer):
42764279
reclaim_buffer()

design/mvp/Concurrency.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -436,10 +436,6 @@ stackless async ABI is used, returning the "exit" code to the event loop. This
436436
non-reuse of thread-local storage between distinct export calls avoids what
437437
would otherwise be a likely source of TLS-related memory leaks.
438438

439-
When [wasm-gc] is integrated into the Canonical ABI, `context.{get,set}` will be
440-
relaxed so that these integral context values can serve as indices into
441-
guest-managed tables of typed GC references.
442-
443439
Since the same mutable thread-local storage cells are shared by all core wasm
444440
running under the same thread in the same component, the cells' contents must
445441
be carefully coordinated in the same way as native code has to carefully

0 commit comments

Comments
 (0)