Extract CPU counting to doom-num-cpus function
And improves macOS support as discussed in hlissner/doom-emacs@db6a27c
This commit is contained in:
parent
b49c40bbb3
commit
b91a1b3e7b
3 changed files with 22 additions and 13 deletions
|
@ -299,13 +299,7 @@ config.el instead."
|
|||
(defadvice! doom--comp-use-all-cores-a ()
|
||||
:override #'comp-effective-async-max-jobs
|
||||
(if (zerop comp-async-jobs-number)
|
||||
(or comp-num-cpus
|
||||
(setf comp-num-cpus
|
||||
(max 1 (cond ((eq 'windows-nt system-type)
|
||||
(string-to-number (getenv "NUMBER_OF_PROCESSORS")))
|
||||
((executable-find "nproc")
|
||||
(string-to-number (cdr (doom-call-process "nproc"))))
|
||||
(t 1)))))
|
||||
(setq comp-num-cpus (doom-num-cpus))
|
||||
comp-async-jobs-number)))
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue