Skip to content

Commit 2e18af1

Browse files
committed
Reflect 0-len/drop semantic changes to Overview.md
This reflects spec changes in WebAssembly#126 in Overview.md.
1 parent 1e29660 commit 2e18af1

File tree

1 file changed

+11
-20
lines changed

1 file changed

+11
-20
lines changed

proposals/bulk-memory-operations/Overview.md

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -281,10 +281,8 @@ Note that it is allowed to use `memory.init` on the same data segment more than
281281
once.
282282

283283
Initialization takes place bytewise from lower addresses toward higher
284-
addresses. A trap resulting from an access outside the source data
285-
segment or target memory only occurs once the first byte that is
286-
outside the source or target is reached. Bytes written before the
287-
trap stay written.
284+
addresses. When a trap resulting from an access outside the source data segment
285+
or target memory occurs, partial initialization does not take place.
288286

289287
(Data are read and written as-if individual bytes were read and
290288
written, but various optimizations are possible that avoid reading and
@@ -297,17 +295,14 @@ succeeded will have to be written, if possible.
297295

298296
### `data.drop` instruction
299297

300-
The `data.drop` instruction prevents further use of a given segment. After a
301-
data segment has been dropped, it is no longer valid to use it in a `memory.init`
302-
instruction. This instruction is intended to be used as an optimization hint to
303-
the WebAssembly implementation. After a memory segment is dropped its data can
304-
no longer be retrieved, so the memory used by this segment may be freed.
298+
The `data.drop` instruction prevents further use of a given segment. Dropping a
299+
segment has an effect of shrinking the segment to size 0. This instruction is
300+
intended to be used as an optimization hint to the WebAssembly implementation.
301+
After a memory segment is dropped its data can no longer be retrieved, so the
302+
memory used by this segment may be freed.
305303

306304
It is a validation error to use `data.drop` with an out-of-bounds segment index.
307305

308-
A trap occurs if the segment was already dropped. This includes active segments
309-
that were dropped after being copied into memory during module instantiation.
310-
311306
### `memory.copy` instruction
312307

313308
Copy data from a source memory region to destination region. The
@@ -338,11 +333,8 @@ The instruction has the signature `[i32 i32 i32] -> []`. The parameters are, in
338333
A trap occurs if:
339334
* the source offset plus size is greater than the length of the source memory
340335
* the destination offset plus size is greater than the length of the target memory
341-
342-
A trap resulting from an access outside the source or target region
343-
only occurs once the first byte that is outside the source or target
344-
is reached (in the defined copy order). Bytes written before the trap
345-
stay written.
336+
When a trap resulting from an access outside the source or target region occurs,
337+
partial copying does not take place.
346338

347339
(Data are read and written as-if individual bytes were read and
348340
written, but various optimizations are possible that avoid reading and
@@ -363,9 +355,8 @@ A trap occurs if:
363355
* the destination offset plus size is greater than the length of the target memory
364356

365357
Filling takes place bytewise from lower addresses toward higher
366-
addresses. A trap resulting from an access outside the target memory
367-
only occurs once the first byte that is outside the target is reached.
368-
Bytes written before the trap stay written.
358+
addresses. When a trap resulting from an access outside the target memory
359+
occurs, partial filling does not take place.
369360

370361
(Data are written as-if individual bytes were written, but various
371362
optimizations are possible that avoid writing only individual bytes.)

0 commit comments

Comments
 (0)