mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-22 00:00:11 +02:00
chore: use boxed slice if possible (#6858)
This commit is contained in:
@@ -14,7 +14,7 @@ use tokio::task::{spawn_local, JoinHandle, LocalSet};
|
||||
/// Internally the local pool uses a [`tokio::task::LocalSet`] for each worker thread
|
||||
/// in the pool. Consequently you can also use [`tokio::task::spawn_local`] (which will
|
||||
/// execute on the same thread) inside the Future you supply to the various spawn methods
|
||||
/// of `LocalPoolHandle`,
|
||||
/// of `LocalPoolHandle`.
|
||||
///
|
||||
/// [`tokio::task::LocalSet`]: tokio::task::LocalSet
|
||||
/// [`tokio::task::spawn_local`]: tokio::task::spawn_local
|
||||
@@ -194,7 +194,7 @@ enum WorkerChoice {
|
||||
}
|
||||
|
||||
struct LocalPool {
|
||||
workers: Vec<LocalWorkerHandle>,
|
||||
workers: Box<[LocalWorkerHandle]>,
|
||||
}
|
||||
|
||||
impl LocalPool {
|
||||
|
||||
@@ -34,7 +34,7 @@ pub(crate) struct Wheel<T> {
|
||||
/// * ~ 4 min slots / ~ 4 hr range
|
||||
/// * ~ 4 hr slots / ~ 12 day range
|
||||
/// * ~ 12 day slots / ~ 2 yr range
|
||||
levels: Vec<Level<T>>,
|
||||
levels: Box<[Level<T>]>,
|
||||
}
|
||||
|
||||
/// Number of levels. Each level has 64 slots. By using 6 levels with 64 slots
|
||||
|
||||
@@ -18,7 +18,7 @@ use std::sync::atomic::{AtomicBool, Ordering};
|
||||
use std::sync::Once;
|
||||
use std::task::{Context, Poll};
|
||||
|
||||
pub(crate) type OsStorage = Vec<SignalInfo>;
|
||||
pub(crate) type OsStorage = Box<[SignalInfo]>;
|
||||
|
||||
impl Init for OsStorage {
|
||||
fn init() -> Self {
|
||||
|
||||
Reference in New Issue
Block a user