mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
minor spelling tweaks
This commit is contained in:
@@ -13,20 +13,20 @@ For example, the string "Hello World" would be encoded as `(uint32_t)11` `"Hello
|
||||
|
||||
## Serialization of objects
|
||||
|
||||
An object consists of its size, measured in the number of fields and represented as a `uint_32t` in little endian order, followed by the direct concatenation of its fields. Because each field is again prefixed with its size, no delimites are necessary in between the fields.
|
||||
An object consists of its size, measured in the number of fields and represented as a `uint_32t` in little endian order, followed by the direct concatenation of its fields. Because each field is again prefixed with its size, no delimits are necessary in between the fields.
|
||||
|
||||
To distinguish scalars and objects, the size of objects has its most-siginificant bit set to 1. It must be ignored to retrieve the number of fields in the object.
|
||||
To distinguish scalars and objects, the size of objects has its most-significant bit set to 1. It must be ignored to retrieve the number of fields in the object.
|
||||
|
||||
Arrays are modelled as objects whose fields are all of the same type and whose length is variadic (and is indicated by the object's size).
|
||||
|
||||
## Versioning
|
||||
|
||||
The ByteTree format is prepended by a 4-byte protocol version number that describes the version of the object tree that was serialized. Its exact semantics are up to each specific application, but it is encouraged to interpret it as a two-comentent number where the first component, consisting of the three most significant bytes, is incremented for breaking changes and the last byte is incremented for backwards-compatible changes.
|
||||
The ByteTree format is prepended by a 4-byte protocol version number that describes the version of the object tree that was serialized. Its exact semantics are up to each specific application, but it is encouraged to interpret it as a two-component number where the first component, consisting of the three most significant bytes, is incremented for breaking changes and the last byte is incremented for backwards-compatible changes.
|
||||
|
||||
## Forward compatilibity
|
||||
## Forward compatibility
|
||||
|
||||
Fields may be added to the end of objects in a backwards compatible manner (older deserialisers will still be able to deserialise the format). It does so by skipping over all fields that are not read during deserialisation. Newer versions of the deserialiser can detect if recently added fields are not present in the serialised data by inspecting the `numFields` property passed during deserialisation.
|
||||
|
||||
## Serialization safety
|
||||
|
||||
Since all fields in objects are accessed by their index, issues quickly arise if a new field is accidentally added at the beginning of an object. To prevent issues like this, the ByteTree serialiser and deserialiser requires the explicit specification of each field's index within the object. These indicies are never serialised. Their sole purpose is to check that all fields are read in the correct order in assertion builds.
|
||||
Since all fields in objects are accessed by their index, issues quickly arise if a new field is accidentally added at the beginning of an object. To prevent issues like this, the ByteTree serialiser and deserialiser requires the explicit specification of each field's index within the object. These indices are never serialised. Their sole purpose is to check that all fields are read in the correct order in assertion builds.
|
||||
|
||||
@@ -695,7 +695,7 @@ files in `<directory>`.
|
||||
|
||||
This option also provides _some_ high-level counters that are "always available"
|
||||
regardless of whether you're using an assert or release build, though assert
|
||||
builds still get _more_ counters (all of those available thorugh
|
||||
builds still get _more_ counters (all of those available through
|
||||
`-print-stats`). If you are using a new-enough compiler, `-stats-output-dir`
|
||||
often simplifies analysis, since its output is machine-readable and aggregates
|
||||
all the jobs in a multi-job compilation, and there's a post-processing script
|
||||
@@ -1322,7 +1322,7 @@ internals of the compiler, just time and patience.
|
||||
|
||||
- Add Open Source projects to the
|
||||
[source-compatibility testsuite](https://swift.org/source-compatibility/).
|
||||
Apple's internal CI infastructure is now tracking selected non-assert-build
|
||||
Apple's internal CI infrastructure is now tracking selected non-assert-build
|
||||
`UnifiedStatsReporter` counters on those projects, and the team is far
|
||||
more likely to catch a regression if it's shown by a project in the testsuite.
|
||||
|
||||
|
||||
@@ -13,4 +13,4 @@ following implementation details:
|
||||
- Linux, FreeBSD, and other UNIX-like platforms use `getrandom(2)` when available;
|
||||
otherwise, they read from `/dev/urandom`.
|
||||
- Fuchsia platforms use `getentropy(3)`.
|
||||
- Windows paltforms use `BCryptGenRandom`.
|
||||
- Windows platforms use `BCryptGenRandom`.
|
||||
|
||||
@@ -4750,7 +4750,7 @@ A ``convert_escape_to_noescape [not_guaranteed] %opd`` indicates that the
|
||||
lifetime of its operand was not guaranteed by SILGen and a mandatory pass must
|
||||
be run to ensure the lifetime of ``%opd``` for the conversion's uses.
|
||||
|
||||
A ``convert_escape_to_noescape [escaped]`` indiciates that the result was
|
||||
A ``convert_escape_to_noescape [escaped]`` indicates that the result was
|
||||
passed to a function (materializeForSet) which escapes the closure in a way not
|
||||
expressed by the convert's users. The mandatory pass must ensure the lifetime
|
||||
in a conservative way.
|
||||
|
||||
@@ -172,7 +172,7 @@ TBD: Possibly link to a separate document explaining the architecture of IRGen.
|
||||
## SILAnalysis and the PassManager
|
||||
|
||||
TBD: describe the mechanism by which passes invalidate and update the
|
||||
PassManager and its avaiable analyses.
|
||||
PassManager and its available analyses.
|
||||
|
||||
## High Level SIL Optimizations
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ Currently there are three supported ways to build Swift for Windows.
|
||||
`clang-cl` is recommended over MSVC for building Swift on Windows.
|
||||
Although it is possible to build the compiler and the standard library with
|
||||
MSVC to use those built products to compile a Swift program, it won't be
|
||||
possible to run the binary without seperately obtaining the Swift runtime. On
|
||||
possible to run the binary without separately obtaining the Swift runtime. On
|
||||
the other hand, `clang-cl` is able to build the runtime, which makes it
|
||||
possible to build and run all the components required for Swift natively on
|
||||
Windows.
|
||||
|
||||
Reference in New Issue
Block a user