diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-06-18 10:10:49 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-06-18 10:10:49 +0000 |
commit | 8e1d74da473a053bb355006e2ff52f2c37226348 (patch) | |
tree | eca5b2ac10cdbb31abf0d461b1e391acfc6882df | |
parent | eaedadb34c2ffcfd06104233769e5ffb1095befd (diff) |
sync to libc
-rw-r--r-- | sys/lib/libkern/mcount.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/lib/libkern/mcount.c b/sys/lib/libkern/mcount.c index f0aee538c3b..acdde38523d 100644 --- a/sys/lib/libkern/mcount.c +++ b/sys/lib/libkern/mcount.c @@ -1,4 +1,4 @@ -/* $NetBSD: mcount.c,v 1.3 1995/03/28 20:01:02 jtc Exp $ */ +/* $NetBSD: mcount.c,v 1.3.6.1 1996/06/12 04:23:01 cgd Exp $ */ /*- * Copyright (c) 1983, 1992, 1993 @@ -34,7 +34,11 @@ */ #if !defined(lint) && !defined(_KERNEL) && defined(LIBC_SCCS) +#if 0 static char sccsid[] = "@(#)mcount.c 8.1 (Berkeley) 6/4/93"; +#else +static char rcsid[] = "$NetBSD: mcount.c,v 1.3.6.1 1996/06/12 04:23:01 cgd Exp $"; +#endif #endif #include <sys/param.h> @@ -87,7 +91,14 @@ _MCOUNT_DECL(frompc, selfpc) /* _mcount; may be static, inline, etc */ if (frompc > p->textsize) goto done; - frompcindex = &p->froms[frompc / (p->hashfraction * sizeof(*p->froms))]; +#if (HASHFRACTION & (HASHFRACTION - 1)) == 0 + if (p->hashfraction == HASHFRACTION) + frompcindex = + &p->froms[frompc / (HASHFRACTION * sizeof(*p->froms))]; + else +#endif + frompcindex = + &p->froms[frompc / (p->hashfraction * sizeof(*p->froms))]; toindex = *frompcindex; if (toindex == 0) { /* |