Skip to content

Commit

Permalink
disable lifo slot to make all tasks stealable
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Jan 29, 2025
1 parent e1e9b26 commit b356147
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions crates/napi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,25 @@ static ALLOC: dhat::Alloc = dhat::Alloc;
#[napi::module_init]

fn init() {
use tokio::runtime::Builder;
use turbo_tasks_malloc::TurboMalloc;

set_hook(Box::new(|panic_info| {
util::log_internal_error_and_inform(&format!(
"Panic: {}\nBacktrace: {:?}",
panic_info,
Backtrace::new()
));
}));
let rt = Builder::new_multi_thread()
.enable_all()
.on_thread_stop(|| {
TurboMalloc::thread_stop();
})
.disable_lifo_slot()

Check failure on line 94 in crates/napi/src/lib.rs

View workflow job for this annotation

GitHub Actions / build-native-windows / build

no method named `disable_lifo_slot` found for mutable reference `&mut tokio::runtime::Builder` in the current scope
.build()
.unwrap();
create_custom_tokio_runtime(rt);
}

#[inline]
Expand Down
1 change: 1 addition & 0 deletions turbopack/crates/turbopack-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ fn main() {
.on_thread_stop(|| {
TurboMalloc::thread_stop();
})
.disable_lifo_slot()
.build()
.unwrap()
.block_on(main_inner(args))
Expand Down

0 comments on commit b356147

Please sign in to comment.