diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2021-03-17 19:23:17 +0100 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2021-03-30 18:10:07 +0200 |
| commit | 65a8681a1701fa01e62a9fc9698e682df465f2ec (patch) | |
| tree | 450d043fec874c628b9feb5938da239dbe0ec50a /compiler/rustc_query_system/src | |
| parent | c5c935af9218c64f5960bd2af58a086e580b35e9 (diff) | |
| download | rust-65a8681a1701fa01e62a9fc9698e682df465f2ec.tar.gz rust-65a8681a1701fa01e62a9fc9698e682df465f2ec.zip | |
Add documentation.
Diffstat (limited to 'compiler/rustc_query_system/src')
| -rw-r--r-- | compiler/rustc_query_system/src/dep_graph/serialized.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/compiler/rustc_query_system/src/dep_graph/serialized.rs b/compiler/rustc_query_system/src/dep_graph/serialized.rs index ab97222e19a..663113543fc 100644 --- a/compiler/rustc_query_system/src/dep_graph/serialized.rs +++ b/compiler/rustc_query_system/src/dep_graph/serialized.rs @@ -1,4 +1,16 @@ //! The data that we will serialize and deserialize. +//! +//! The dep-graph is serialized as a sequence of NodeInfo, with the dependencies +//! specified inline. The total number of nodes and edges are stored as the last +//! 16 bytes of the file, so we can find them easily at decoding time. +//! +//! The serialisation is performed on-demand when each node is emitted. Using this +//! scheme, we do not need to keep the current graph in memory. +//! +//! The deserisalisation is performed manually, in order to convert from the stored +//! sequence of NodeInfos to the different arrays in SerializedDepGraph. Since the +//! node and edge count are stored at the end of the file, all the arrays can be +//! pre-allocated with the right length. use super::query::DepGraphQuery; use super::{DepKind, DepNode, DepNodeIndex}; |
