tmp/tmplnfdy6_5/{from.md → to.md}
RENAMED
|
@@ -2,34 +2,41 @@
|
|
| 2 |
|
| 3 |
The fundamental storage unit in the C++memory model is the *byte*. A
|
| 4 |
byte is at least large enough to contain any member of the basic
|
| 5 |
execution character set ([[lex.charset]]) and the eight-bit code units
|
| 6 |
of the Unicode UTF-8 encoding form and is composed of a contiguous
|
| 7 |
-
sequence of bits, the number of which is *implementation-defined*.
|
| 8 |
-
least significant bit is called the *low-order bit*; the most
|
| 9 |
significant bit is called the *high-order bit*. The memory available to
|
| 10 |
a C++program consists of one or more sequences of contiguous bytes.
|
| 11 |
Every byte has a unique address.
|
| 12 |
|
| 13 |
-
The representation of types is described in
|
|
|
|
| 14 |
|
| 15 |
A *memory location* is either an object of scalar type or a maximal
|
| 16 |
-
sequence of adjacent bit-fields all having
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
A structure declared as
|
| 33 |
|
| 34 |
``` cpp
|
| 35 |
struct {
|
|
@@ -47,5 +54,7 @@ contains four separate memory locations: The field `a` and bit-fields
|
|
| 47 |
concurrently without interfering with each other. The bit-fields `b` and
|
| 48 |
`c` together constitute the fourth memory location. The bit-fields `b`
|
| 49 |
and `c` cannot be concurrently modified, but `b` and `a`, for example,
|
| 50 |
can be.
|
| 51 |
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
The fundamental storage unit in the C++memory model is the *byte*. A
|
| 4 |
byte is at least large enough to contain any member of the basic
|
| 5 |
execution character set ([[lex.charset]]) and the eight-bit code units
|
| 6 |
of the Unicode UTF-8 encoding form and is composed of a contiguous
|
| 7 |
+
sequence of bits,[^4] the number of which is *implementation-defined*.
|
| 8 |
+
The least significant bit is called the *low-order bit*; the most
|
| 9 |
significant bit is called the *high-order bit*. The memory available to
|
| 10 |
a C++program consists of one or more sequences of contiguous bytes.
|
| 11 |
Every byte has a unique address.
|
| 12 |
|
| 13 |
+
[*Note 1*: The representation of types is described in
|
| 14 |
+
[[basic.types]]. — *end note*]
|
| 15 |
|
| 16 |
A *memory location* is either an object of scalar type or a maximal
|
| 17 |
+
sequence of adjacent bit-fields all having nonzero width.
|
| 18 |
+
|
| 19 |
+
[*Note 2*: Various features of the language, such as references and
|
| 20 |
+
virtual functions, might involve additional memory locations that are
|
| 21 |
+
not accessible to programs but are managed by the
|
| 22 |
+
implementation. — *end note*]
|
| 23 |
+
|
| 24 |
+
Two or more threads of execution ([[intro.multithread]]) can access
|
| 25 |
+
separate memory locations without interfering with each other.
|
| 26 |
+
|
| 27 |
+
[*Note 3*: Thus a bit-field and an adjacent non-bit-field are in
|
| 28 |
+
separate memory locations, and therefore can be concurrently updated by
|
| 29 |
+
two threads of execution without interference. The same applies to two
|
| 30 |
+
bit-fields, if one is declared inside a nested struct declaration and
|
| 31 |
+
the other is not, or if the two are separated by a zero-length bit-field
|
| 32 |
+
declaration, or if they are separated by a non-bit-field declaration. It
|
| 33 |
+
is not safe to concurrently update two bit-fields in the same struct if
|
| 34 |
+
all fields between them are also bit-fields of nonzero
|
| 35 |
+
width. — *end note*]
|
| 36 |
+
|
| 37 |
+
[*Example 1*:
|
| 38 |
|
| 39 |
A structure declared as
|
| 40 |
|
| 41 |
``` cpp
|
| 42 |
struct {
|
|
|
|
| 54 |
concurrently without interfering with each other. The bit-fields `b` and
|
| 55 |
`c` together constitute the fourth memory location. The bit-fields `b`
|
| 56 |
and `c` cannot be concurrently modified, but `b` and `a`, for example,
|
| 57 |
can be.
|
| 58 |
|
| 59 |
+
— *end example*]
|
| 60 |
+
|