Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 65a8681

Browse files
committed
Add documentation.
1 parent c5c935a commit 65a8681

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

compiler/rustc_query_system/src/dep_graph/serialized.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
//! The data that we will serialize and deserialize.
2+
//!
3+
//! The dep-graph is serialized as a sequence of NodeInfo, with the dependencies
4+
//! specified inline. The total number of nodes and edges are stored as the last
5+
//! 16 bytes of the file, so we can find them easily at decoding time.
6+
//!
7+
//! The serialisation is performed on-demand when each node is emitted. Using this
8+
//! scheme, we do not need to keep the current graph in memory.
9+
//!
10+
//! The deserisalisation is performed manually, in order to convert from the stored
11+
//! sequence of NodeInfos to the different arrays in SerializedDepGraph. Since the
12+
//! node and edge count are stored at the end of the file, all the arrays can be
13+
//! pre-allocated with the right length.
214
315
use super::query::DepGraphQuery;
416
use super::{DepKind, DepNode, DepNodeIndex};

0 commit comments

Comments
 (0)