Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix consistency issue with reading collectibles #3878

Merged
merged 4 commits into from
Feb 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions crates/turbo-tasks-memory/src/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ use turbo_tasks::{
TaskId, TurboTasksBackendApi,
};

use crate::MemoryBackend;

#[derive(Default, Debug)]
pub(crate) enum Cell {
/// No content has been set yet, or it was removed for memory pressure
Expand Down Expand Up @@ -204,7 +206,11 @@ impl Cell {
}
}

pub fn assign(&mut self, content: CellContent, turbo_tasks: &dyn TurboTasksBackendApi) {
pub fn assign(
&mut self,
content: CellContent,
turbo_tasks: &dyn TurboTasksBackendApi<MemoryBackend>,
) {
match self {
Cell::Empty => {
*self = Cell::Value {
Expand Down Expand Up @@ -287,7 +293,7 @@ impl Cell {
}

/// Drops the cell after GC. Will notify all dependent tasks and events.
pub fn gc_drop(self, turbo_tasks: &dyn TurboTasksBackendApi) {
pub fn gc_drop(self, turbo_tasks: &dyn TurboTasksBackendApi<MemoryBackend>) {
match self {
Cell::Empty => {}
Cell::Recomputing {
Expand Down
2 changes: 1 addition & 1 deletion crates/turbo-tasks-memory/src/gc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ impl GcQueue {
&self,
factor: u8,
backend: &MemoryBackend,
turbo_tasks: &dyn TurboTasksBackendApi,
turbo_tasks: &dyn TurboTasksBackendApi<MemoryBackend>,
) -> Option<(GcPriority, usize, GcStats)> {
// Process through the inactive propagation queue.
while let Ok(task) = self.inactive_propagate_queue.pop() {
Expand Down
Loading