Render: keep the automatic thread helper out of Wasm libraries

This commit is contained in:
dotCooCoo
2026-11-04 08:12:09 +07:00
committed by bflatastic
parent 4338ef75e3
commit c6e47fece3
+1
View File
@@ -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