mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-09 06:06:38 +00:00
Render: keep the automatic thread helper out of Wasm libraries
This commit is contained in:
@@ -49,6 +49,7 @@ pub fn default_threads() -> u16 {
|
||||
|
||||
/// [`default_threads`] when automatic, on `cpus` processors of which the process may use `usable`
|
||||
/// (0 = all).
|
||||
#[cfg(any(test, not(target_arch = "wasm32")))]
|
||||
fn automatic_threads(cpus: usize, usable: usize) -> u16 {
|
||||
let cores = if usable == 0 { cpus } else { cpus.min(usable) };
|
||||
(cores.saturating_sub(1)).min(8) as u16
|
||||
|
||||
Reference in New Issue
Block a user