next.js
e7276e1d - turbo-tasks: route TaskStorageAccessors through TaskStorageBox

Commit
72 days ago
turbo-tasks: route TaskStorageAccessors through TaskStorageBox `typed()` / `typed_mut()` on the `TaskStorageAccessors` trait now return `&TaskStorageBox` / `&mut TaskStorageBox` rather than the inner `&TaskStorage` / `&mut TaskStorage`. `TaskStorageBox` implements `Deref<Target = TaskStorage>`, so every existing macro-emitted callsite of the form `self.typed().<field>()` keeps working unchanged — the inline-field and lazy-field accessors are still defined on `TaskStorage` and reached via deref coercion. Why: step 3 of the refactor will inline `LazyTail`'s byte buffer into `TaskStorageBox`'s heap allocation, and the grow-capable lazy mutations (currently `LazyTail::install` on `&mut LazyTail`) need access to the owning pointer to relocate the buffer. Returning the box from `typed_mut()` is the seam those grow paths will hook into. `StorageWriteGuard::Deref::Target` flips from `TaskStorage` to `TaskStorageBox` for the same reason. The deref chain via `RefMut` collapses to a single explicit step. 50 backend tests pass; whole workspace builds.
Author
Committer
Parents
Loading