@@ -281,10 +281,8 @@ Note that it is allowed to use `memory.init` on the same data segment more than
281
281
once.
282
282
283
283
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.
288
286
289
287
(Data are read and written as-if individual bytes were read and
290
288
written, but various optimizations are possible that avoid reading and
@@ -297,17 +295,14 @@ succeeded will have to be written, if possible.
297
295
298
296
### ` data.drop ` instruction
299
297
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.
305
303
306
304
It is a validation error to use ` data.drop ` with an out-of-bounds segment index.
307
305
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
-
311
306
### ` memory.copy ` instruction
312
307
313
308
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
338
333
A trap occurs if:
339
334
* the source offset plus size is greater than the length of the source memory
340
335
* 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.
346
338
347
339
(Data are read and written as-if individual bytes were read and
348
340
written, but various optimizations are possible that avoid reading and
@@ -363,9 +355,8 @@ A trap occurs if:
363
355
* the destination offset plus size is greater than the length of the target memory
364
356
365
357
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.
369
360
370
361
(Data are written as-if individual bytes were written, but various
371
362
optimizations are possible that avoid writing only individual bytes.)
0 commit comments