Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Side by Side Diff: courgette/label_manager.h

Issue 1935203002: [Courgette] Using LabelManager to reduce Courgette-apply peak RAM by 25%. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « courgette/image_utils.h ('k') | courgette/label_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COURGETTE_LABEL_MANAGER_H_ 5 #ifndef COURGETTE_LABEL_MANAGER_H_
6 #define COURGETTE_LABEL_MANAGER_H_ 6 #define COURGETTE_LABEL_MANAGER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 // Tracker for index usage to ensure uniqueness of indexes. 74 // Tracker for index usage to ensure uniqueness of indexes.
75 std::vector<bool> available_; 75 std::vector<bool> available_;
76 76
77 DISALLOW_COPY_AND_ASSIGN(SimpleIndexAssigner); 77 DISALLOW_COPY_AND_ASSIGN(SimpleIndexAssigner);
78 }; 78 };
79 79
80 LabelManager(); 80 LabelManager();
81 ~LabelManager(); 81 ~LabelManager();
82 82
83 // Returns an exclusive upper bound for all existing indexes in |labels_map|.
84 // TODO(huangs): Remove once all callers are gone.
85 static int GetIndexBound(const RVAToLabel& labels_map);
86
87 // Returns an exclusive upper bound for all assigned indexes in |labels|. 83 // Returns an exclusive upper bound for all assigned indexes in |labels|.
88 static int GetLabelIndexBound(const LabelVector& labels); 84 static int GetLabelIndexBound(const LabelVector& labels);
89 85
90 // Accessor to stored Label instances. 86 // Accessor to stored Label instances.
91 const LabelVector& Labels() const { return labels_; } 87 const LabelVector& Labels() const { return labels_; }
92 88
93 // Efficiently searches for a Label that targets |rva|. Returns the pointer to 89 // Efficiently searches for a Label that targets |rva|. Returns the pointer to
94 // the stored Label instance if found, or null otherwise. Non-const to support 90 // the stored Label instance if found, or null otherwise. Non-const to support
95 // implementations that allocate-on-read. 91 // implementations that allocate-on-read.
96 Label* Find(RVA rva); 92 Label* Find(RVA rva);
(...skipping 22 matching lines...) Expand all
119 // The main list of Label instances, sorted by the |rva_| member. 115 // The main list of Label instances, sorted by the |rva_| member.
120 LabelVector labels_; 116 LabelVector labels_;
121 117
122 private: 118 private:
123 DISALLOW_COPY_AND_ASSIGN(LabelManager); 119 DISALLOW_COPY_AND_ASSIGN(LabelManager);
124 }; 120 };
125 121
126 } // namespace courgette 122 } // namespace courgette
127 123
128 #endif // COURGETTE_LABEL_MANAGER_H_ 124 #endif // COURGETTE_LABEL_MANAGER_H_
OLDNEW
« no previous file with comments | « courgette/image_utils.h ('k') | courgette/label_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698