Skip to content

Commit cc60300

Browse files
authored
Merge pull request #2705 from elliotgoodrich/reduce-sizeof-edge
Reduce `sizeof(Edge)`
2 parents 47c0467 + e4bff63 commit cc60300

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/graph.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ struct Node {
173173

174174
/// An edge in the dependency graph; links between Nodes using Rules.
175175
struct Edge {
176-
enum VisitMark {
176+
enum VisitMark : char {
177177
VisitNone,
178178
VisitInStack,
179179
VisitDone
@@ -218,9 +218,13 @@ struct Edge {
218218
std::vector<Node*> validations_;
219219
Node* dyndep_ = nullptr;
220220
BindingEnv* env_ = nullptr;
221-
VisitMark mark_ = VisitNone;
222221
size_t id_ = 0;
223222
int64_t critical_path_weight_ = -1;
223+
224+
/// A Jobserver slot instance. Invalid by default.
225+
Jobserver::Slot job_slot_;
226+
227+
VisitMark mark_ = VisitNone;
224228
bool outputs_ready_ = false;
225229
bool deps_loaded_ = false;
226230
bool deps_missing_ = false;
@@ -264,9 +268,6 @@ struct Edge {
264268
bool use_console() const;
265269
bool maybe_phonycycle_diagnostic() const;
266270

267-
/// A Jobserver slot instance. Invalid by default.
268-
Jobserver::Slot job_slot_;
269-
270271
// Historical info: how long did this edge take last time,
271272
// as per .ninja_log, if known? Defaults to -1 if unknown.
272273
int64_t prev_elapsed_time_millis = -1;

0 commit comments

Comments
 (0)