Skip to content

Commit

Permalink
rebase fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Aug 15, 2024
1 parent 4c2cbf0 commit 2979bef
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
18 changes: 11 additions & 7 deletions turbopack/crates/turbo-tasks-backend/src/backend/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,8 @@ impl Default for TurboTasksBackend {
impl TurboTasksBackend {
pub fn new() -> Self {
Self {
persisted_task_id_factory: IdFactoryWithReuse::new_with_range(
1,
(TRANSIENT_TASK_BIT - 1) as u64,
),
transient_task_id_factory: IdFactoryWithReuse::new_with_range(
persisted_task_id_factory: IdFactoryWithReuse::new(1, (TRANSIENT_TASK_BIT - 1) as u64),
transient_task_id_factory: IdFactoryWithReuse::new(
TRANSIENT_TASK_BIT as u64,
u32::MAX as u64,
),
Expand Down Expand Up @@ -521,8 +518,14 @@ impl Backend for TurboTasksBackend {
else {
unreachable!()
};
CachedTaskType::run_resolve_native(*fn_type, *this, &**arg, turbo_tasks)
.await
CachedTaskType::run_resolve_native(
*fn_type,
*this,
&**arg,
task_id.is_transient(),
turbo_tasks,
)
.await
}) as Pin<Box<dyn Future<Output = _> + Send + '_>>,
)
}
Expand Down Expand Up @@ -550,6 +553,7 @@ impl Backend for TurboTasksBackend {
method_name.clone(),
*this,
&**arg,
task_id.is_transient(),
turbo_tasks,
)
.await
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ impl<'a> TaskGuard<'a> {
self.task.get(key)
}

pub fn has_key(&self, key: &CachedDataItemKey) -> bool {
self.task.has_key(key)
}

pub fn iter(&self) -> impl Iterator<Item = (&CachedDataItemKey, &CachedDataItemValue)> {
self.task.iter()
}
Expand Down
4 changes: 4 additions & 0 deletions turbopack/crates/turbo-tasks-backend/src/backend/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ impl<T: KeyValuePair> InnerStorage<T> {
self.map.get(key)
}

pub fn has_key(&self, key: &T::Key) -> bool {
self.map.contains_key(key)
}

pub fn iter(&self) -> impl Iterator<Item = (&T::Key, &T::Value)> {
self.map.iter()
}
Expand Down
3 changes: 2 additions & 1 deletion turbopack/crates/turbo-tasks-backend/src/data.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use serde::{Deserialize, Serialize};
use turbo_tasks::{event::Event, util::SharedError, CellId, KeyValuePair, SharedReference, TaskId};

#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, Serialize, Deserialize)]
pub struct CellRef {
pub task: TaskId,
pub cell: CellId,
Expand Down

0 comments on commit 2979bef

Please sign in to comment.