diff --git a/actix-rt/Cargo.toml b/actix-rt/Cargo.toml index d00346f3..a059c6e0 100644 --- a/actix-rt/Cargo.toml +++ b/actix-rt/Cargo.toml @@ -24,3 +24,4 @@ tokio-current-thread = "0.1" tokio-executor = "0.1.5" tokio-reactor = "0.1.7" tokio-timer = "0.2.8" +copyless = "0.1.4" diff --git a/actix-rt/src/arbiter.rs b/actix-rt/src/arbiter.rs index 0fba710c..b7cdca0a 100644 --- a/actix-rt/src/arbiter.rs +++ b/actix-rt/src/arbiter.rs @@ -11,6 +11,8 @@ use tokio_current_thread::spawn; use crate::builder::Builder; use crate::system::System; +use copyless::BoxHelper; + thread_local!( static ADDR: RefCell> = RefCell::new(None); static RUNNING: Cell = Cell::new(false); @@ -141,9 +143,9 @@ impl Arbiter { { RUNNING.with(move |cell| { if cell.get() { - spawn(Box::new(future)); + spawn(Box::alloc().init(future)); } else { - Q.with(move |cell| cell.borrow_mut().push(Box::new(future))); + Q.with(move |cell| cell.borrow_mut().push(Box::alloc().init(future))); } }); }