Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Add a CTASSERT to make sure the cexp and ldavg arra...



details:   https://anonhg.NetBSD.org/src/rev/b751d59863b2
branches:  trunk
changeset: 754435:b751d59863b2
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Apr 30 10:02:00 2010 +0000

description:
Add a CTASSERT to make sure the cexp and ldavg arrays are kept in sync

diffstat:

 sys/kern/kern_synch.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 128ce0f1585b -r b751d59863b2 sys/kern/kern_synch.c
--- a/sys/kern/kern_synch.c     Fri Apr 30 09:44:38 2010 +0000
+++ b/sys/kern/kern_synch.c     Fri Apr 30 10:02:00 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_synch.c,v 1.282 2010/04/20 16:49:48 rmind Exp $   */
+/*     $NetBSD: kern_synch.c,v 1.283 2010/04/30 10:02:00 martin Exp $  */
 
 /*-
  * Copyright (c) 1999, 2000, 2004, 2006, 2007, 2008, 2009
@@ -69,7 +69,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.282 2010/04/20 16:49:48 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.283 2010/04/30 10:02:00 martin Exp $");
 
 #include "opt_kstack.h"
 #include "opt_perfctrs.h"
@@ -1260,6 +1260,7 @@
        /* Load average calculation. */
        if (__predict_false(lavg_count == 0)) {
                int i;
+               CTASSERT(__arraycount(cexp) == __arraycount(avg->ldavg));
                for (i = 0; i < __arraycount(cexp); i++) {
                        avg->ldavg[i] = (cexp[i] * avg->ldavg[i] +
                            nrun * FSCALE * (FSCALE - cexp[i])) >> FSHIFT;



Home | Main Index | Thread Index | Old Index