Skip to content

Commit 9e7d6c4

Browse files
committed
Editorial: Permit immutable Data Blocks with memory locations that subset other immutable Data Blocks
1 parent 09a5368 commit 9e7d6c4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

spec.emu

+12
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@ shortname: proposal-immutable-arraybuffer
1212
contributors: Mark S. Miller, Richard Gibson
1313
</pre>
1414

15+
<emu-clause id="sec-ecmascript-data-types-and-values" number="6">
16+
<h1>ECMAScript Data Types and Values</h1>
17+
18+
<emu-clause id="sec-data-blocks" number="2.9">
19+
<h1>Data Blocks</h1>
20+
<p>A data block that resides in memory that can be referenced from multiple agents concurrently is designated a <dfn variants="Shared Data Blocks">Shared Data Block</dfn>. A Shared Data Block has an identity (for the purposes of equality testing Shared Data Block values) that is <em>address-free</em>: it is tied not to the virtual addresses the block is mapped to in any process, but to the set of locations in memory that the block represents. Two <del>data blocks</del> <ins>Shared Data Blocks</ins> are equal only if the sets of the locations they contain are equal; otherwise, they are not equal and the intersection of the sets of locations they contain is empty. Finally, Shared Data Blocks can be distinguished from Data Blocks.</p>
21+
</emu-clause>
22+
</emu-clause>
23+
1524
<emu-clause id="sec-operations-on-objects" number="7">
1625
<h1>Operations on Objects</h1>
1726

@@ -484,6 +493,9 @@ contributors: Mark S. Miller, Richard Gibson
484493
1. Perform CopyDataBlockBytes(_toBlock_, 0, _fromBlock_, 0, _count_).
485494
1. Return _newBuffer_.
486495
</emu-alg>
496+
<emu-note>
497+
<p>Because neither the identity of a Data Block nor the set of locations in memory represented by it are observable, implementations may implement this operation without allocating new memory locations when _fromBlock_ is the value of the [[ArrayBufferData]] slot for some other immutable ArrayBuffer (and therefore already immutable) and _count_ = _byteLength_.</p>
498+
</emu-note>
487499
</emu-clause>
488500
</ins>
489501

0 commit comments

Comments
 (0)