Next Generation WASM Microkernel Operating System

fix(kasync): remove `*.try_spawn_in` methods. We cannot actually allocate tasks with an allocator other than the default global one, since we currently do not have the ability to free using a custom allocator.

-52
-22
libs/kasync/src/executor.rs
··· 170 170 { 171 171 self.build_task().try_spawn(future) 172 172 } 173 - 174 - /// Attempt spawn this [`Future`] onto this executor using a custom [`Allocator`]. 175 - /// 176 - /// This method returns a [`TaskRef`] which can be used to spawn it onto an [`crate::executor::Executor`] 177 - /// and a [`JoinHandle`] which can be used to await the futures output as well as control some aspects 178 - /// of its runtime behaviour (such as cancelling it). 179 - /// 180 - /// # Errors 181 - /// 182 - /// Returns [`AllocError`] when allocation of the task fails. 183 - pub fn try_spawn_in<F, A>( 184 - &'static self, 185 - future: F, 186 - alloc: A, 187 - ) -> Result<JoinHandle<F::Output>, SpawnError> 188 - where 189 - F: Future + Send + 'static, 190 - F::Output: Send + 'static, 191 - A: Allocator, 192 - { 193 - self.build_task().try_spawn_in(future, alloc) 194 - } 195 173 } 196 174 197 175 // === impl Worker ===
-30
libs/kasync/src/task/builder.rs
··· 108 108 109 109 Ok(join) 110 110 } 111 - 112 - /// Attempt spawn this [`Future`] onto the executor using a custom [`Allocator`]. 113 - /// 114 - /// This method returns a [`TaskRef`] which can be used to spawn it onto an [`crate::executor::Executor`] 115 - /// and a [`JoinHandle`] which can be used to await the futures output as well as control some aspects 116 - /// of its runtime behaviour (such as cancelling it). 117 - /// 118 - /// # Errors 119 - /// 120 - /// Returns [`AllocError`] when allocation of the task fails. 121 - #[inline] 122 - #[track_caller] 123 - pub fn try_spawn_in<F, A>( 124 - &self, 125 - future: F, 126 - alloc: A, 127 - ) -> Result<JoinHandle<F::Output>, SpawnError> 128 - where 129 - F: Future + Send, 130 - F::Output: Send, 131 - A: Allocator, 132 - { 133 - let task = self.build(future); 134 - let task = Box::try_new_in(task, alloc)?; 135 - let (task, join) = TaskRef::new_allocated(task); 136 - 137 - (self.schedule)(task)?; 138 - 139 - Ok(join) 140 - } 141 111 }