File tree 1 file changed +13
-1
lines changed
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -295,12 +295,24 @@ enum GraphNode {
295
295
Link ( PackageId , PackageId ) ,
296
296
}
297
297
298
+ // A `Context` is basically a bunch of local resolution information which is
299
+ // kept around for all `BacktrackFrame` instances. As a result, this runs the
300
+ // risk of being cloned *a lot* so we want to make this as cheap to clone as
301
+ // possible.
298
302
#[ derive( Clone ) ]
299
303
struct Context < ' a > {
304
+ // TODO: Both this and the map below are super expensive to clone. We should
305
+ // switch to persistent hash maps if we can at some point or otherwise
306
+ // make these much cheaper to clone in general.
300
307
activations : Activations ,
301
- resolve_graph : RcList < GraphNode > ,
302
308
resolve_features : HashMap < PackageId , HashSet < String > > ,
309
+
310
+ // These are two cheaply-cloneable lists (O(1) clone) which are effectively
311
+ // hash maps but are built up as "construction lists". We'll iterate these
312
+ // at the very end and actually construct the map that we're making.
313
+ resolve_graph : RcList < GraphNode > ,
303
314
resolve_replacements : RcList < ( PackageId , PackageId ) > ,
315
+
304
316
replacements : & ' a [ ( PackageIdSpec , Dependency ) ] ,
305
317
}
306
318
You can’t perform that action at this time.
0 commit comments