@@ -79,18 +79,19 @@ struct ReadScopeCollectiblesTaskType {
79
79
80
80
/// Different Task types
81
81
enum TaskType {
82
+ // Note: double boxed to reduce TaskType size
82
83
/// A root task that will track dependencies and re-execute when
83
84
/// dependencies change. Task will eventually settle to the correct
84
85
/// execution.
85
- Root ( NativeTaskFn ) ,
86
+ Root ( Box < NativeTaskFn > ) ,
86
87
87
- // TODO implement these strongly consistency
88
+ // Note: double boxed to reduce TaskType size
88
89
/// A single root task execution. It won't track dependencies.
89
90
/// Task will definitely include all invalidations that happened before the
90
91
/// start of the task. It may or may not include invalidations that
91
92
/// happened after that. It may see these invalidations partially
92
93
/// applied.
93
- Once ( OnceTaskFn ) ,
94
+ Once ( Box < OnceTaskFn > ) ,
94
95
95
96
/// A task that reads all collectibles of a certain trait from a
96
97
/// [TaskScope]. It will do that by recursively calling
@@ -540,7 +541,7 @@ impl Task {
540
541
functor : impl Fn ( ) -> NativeTaskFuture + Sync + Send + ' static ,
541
542
stats_type : StatsType ,
542
543
) -> Self {
543
- let ty = TaskType :: Root ( Box :: new ( functor) ) ;
544
+ let ty = TaskType :: Root ( Box :: new ( Box :: new ( functor) ) ) ;
544
545
let description = Self :: get_event_description_static ( id, & ty) ;
545
546
Self {
546
547
id,
@@ -559,7 +560,7 @@ impl Task {
559
560
functor : impl Future < Output = Result < RawVc > > + Send + ' static ,
560
561
stats_type : StatsType ,
561
562
) -> Self {
562
- let ty = TaskType :: Once ( Mutex :: new ( Some ( Box :: pin ( functor) ) ) ) ;
563
+ let ty = TaskType :: Once ( Box :: new ( Mutex :: new ( Some ( Box :: pin ( functor) ) ) ) ) ;
563
564
let description = Self :: get_event_description_static ( id, & ty) ;
564
565
Self {
565
566
id,
0 commit comments