summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/comp.el
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2021-03-07 15:32:55 +0200
committerEli Zaretskii <eliz@gnu.org>2021-03-07 15:32:55 +0200
commit619f66f423c76d94b2bca728f9c22b536e909108 (patch)
treeecdea436c993f75d73b325c7552937a223365d80 /lisp/emacs-lisp/comp.el
parent99638d128ee07fa35525ac47217f68dd518e9175 (diff)
downloademacs-619f66f423c76d94b2bca728f9c22b536e909108.tar.gz
emacs-619f66f423c76d94b2bca728f9c22b536e909108.tar.bz2
emacs-619f66f423c76d94b2bca728f9c22b536e909108.zip
Use MS-Windows system APIs to get number of processors
* lisp/emacs-lisp/comp.el: Use 'w32-get-nproc' instead of the environment variable NUMBER_OF_PROCESSORS. * src/w32proc.c (Fw32_get_nproc): New primitive. * src/w32.c (w32_get_nproc): New function. (sample_system_load): Call w32_get_nproc to initialize the number of processors on this system. * src/w32.h (w32_get_nproc): Add prototype.
Diffstat (limited to 'lisp/emacs-lisp/comp.el')
-rw-r--r--lisp/emacs-lisp/comp.el3
1 files changed, 1 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 134b5a28086..70e10644ca8 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -3824,8 +3824,7 @@ processes from `comp-async-compilations'"
;; the number of processors, see get_native_system_info in w32.c.
;; The result needs to be exported to Lisp.
(max 1 (/ (cond ((eq 'windows-nt system-type)
- (string-to-number (getenv
- "NUMBER_OF_PROCESSORS")))
+ (w32-get-nproc))
((executable-find "nproc")
(string-to-number
(shell-command-to-string "nproc")))