Commit 63810350 authored by Paul Eggert's avatar Paul Eggert
Browse files

* sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:

Convert pctcpu and pctmem to Lisp float properly.
Let the compiler fold better, as 100.0/0x8000 is exact.
parent 4cf9b38d
2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
* sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
Convert pctcpu and pctmem to Lisp float properly.
Let the compiler fold better, as 100.0/0x8000 is exact.
2012-06-02 Andreas Schwab <schwab@linux-m68k.org> 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
* alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
......
...@@ -3107,8 +3107,8 @@ system_process_attributes (Lisp_Object pid) ...@@ -3107,8 +3107,8 @@ system_process_attributes (Lisp_Object pid)
attrs = Fcons (Fcons (Qrss, make_fixnum_or_float (pinfo.pr_rssize)), attrs); attrs = Fcons (Fcons (Qrss, make_fixnum_or_float (pinfo.pr_rssize)), attrs);
/* pr_pctcpu and pr_pctmem are encoded as a fixed point 16 bit number in [0 ... 1]. */ /* pr_pctcpu and pr_pctmem are encoded as a fixed point 16 bit number in [0 ... 1]. */
attrs = Fcons (Fcons (Qpcpu, (pinfo.pr_pctcpu * 100.0) / (double)0x8000), attrs); attrs = Fcons (Fcons (Qpcpu, make_float (100.0 / 0x8000 * pinfo.pr_pctcpu)), attrs);
attrs = Fcons (Fcons (Qpmem, (pinfo.pr_pctmem * 100.0) / (double)0x8000), attrs); attrs = Fcons (Fcons (Qpmem, make_float (100.0 / 0x8000 * pinfo.pr_pctmem)), attrs);
decoded_cmd decoded_cmd
= code_convert_string_norecord (make_unibyte_string (pinfo.pr_fname, = code_convert_string_norecord (make_unibyte_string (pinfo.pr_fname,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment