[Cmucl-cvs] [git] CMU Common Lisp branch master updated. 20f-30-g2c1bade

Raymond Toy rtoy at common-lisp.net
Thu Oct 9 00:33:12 UTC 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMU Common Lisp".

The branch, master has been updated
       via  2c1badeff23fe6c6bd1e5f8911b0afdfb005497c (commit)
      from  261157bc0f082d35dec3ef0dbd7315c263f45a3e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 2c1badeff23fe6c6bd1e5f8911b0afdfb005497c
Author: Raymond Toy <toy.raymond at gmail.com>
Date:   Wed Oct 8 17:32:58 2014 -0700

    Fix issue with negative value for lisp::cycles-per-tick.
    
    This causes negative cpu cyles with TIME. Basic issue is that a cpu
    frequency of 2.3 GHZ won't fit in an int. Use an unsigned int.
    
    We also take this opportunity to use a rounded value for
    clocks-per-tick instead of truncating.  For this particular case the
    ratio is actual 68.99 which would truncated to 68. We should probably
    use 69 instead.

diff --git a/src/lisp/Darwin-os.c b/src/lisp/Darwin-os.c
index 5e8ddf9..1f67b68 100644
--- a/src/lisp/Darwin-os.c
+++ b/src/lisp/Darwin-os.c
@@ -66,8 +66,8 @@ void
 timebase_init(void)
 {
     int mib[2];
-    int tbfrequency;
-    int cpufrequency;
+    unsigned tbfrequency;
+    unsigned cpufrequency;
     unsigned int miblen;
     size_t len;
 
@@ -95,7 +95,7 @@ timebase_init(void)
 	perror("Error getting HW_CPU_FREQ from sysctl: ");
     }
 
-    cycles_per_tick = cpufrequency / tbfrequency;
+    cycles_per_tick = 0.5 + (cpufrequency / (double) tbfrequency);
 }
 #endif
 

-----------------------------------------------------------------------

Summary of changes:
 src/lisp/Darwin-os.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
CMU Common Lisp




More information about the cmucl-cvs mailing list