SCCS-vsn: lib/libc/gmon/gmon.c 4.9
-static char *sccsid = "@(#)gmon.c 4.8 (Berkeley) %G%";
+static char *sccsid = "@(#)gmon.c 4.9 (Berkeley) %G%";
#ifdef DEBUG
#include <stdio.h>
#ifdef DEBUG
#include <stdio.h>
write( 2 , MSG , sizeof(MSG) );
return;
}
write( 2 , MSG , sizeof(MSG) );
return;
}
- froms = (unsigned short *) sbrk( s_textsize );
+ froms = (unsigned short *) sbrk( s_textsize / HASHFRACTION );
if ( froms == (unsigned short *) -1 ) {
write( 2 , MSG , sizeof(MSG) );
froms = 0;
if ( froms == (unsigned short *) -1 ) {
write( 2 , MSG , sizeof(MSG) );
froms = 0;
char *frompc;
int toindex;
struct rawarc rawarc;
char *frompc;
int toindex;
struct rawarc rawarc;
fprintf( stderr , "[mcleanup] sbuf 0x%x ssiz %d\n" , sbuf , ssiz );
# endif DEBUG
write( fd , sbuf , ssiz );
fprintf( stderr , "[mcleanup] sbuf 0x%x ssiz %d\n" , sbuf , ssiz );
# endif DEBUG
write( fd , sbuf , ssiz );
- for ( fromindex = 0 ; fromindex < s_textsize>>1 ; fromindex++ ) {
+ endfrom = s_textsize / (HASHFRACTION * sizeof(*froms));
+ for ( fromindex = 0 ; fromindex < endfrom ; fromindex++ ) {
if ( froms[fromindex] == 0 ) {
continue;
}
if ( froms[fromindex] == 0 ) {
continue;
}
- frompc = s_lowpc + (fromindex<<1);
+ frompc = s_lowpc + (fromindex * HASHFRACTION * sizeof(*froms));
for (toindex=froms[fromindex]; toindex!=0; toindex=tos[toindex].link) {
# ifdef DEBUG
fprintf( stderr ,
for (toindex=froms[fromindex]; toindex!=0; toindex=tos[toindex].link) {
# ifdef DEBUG
fprintf( stderr ,
goto done;
}
frompcindex =
goto done;
}
frompcindex =
- &froms[(((long)frompcindex) + sizeof(*froms) - 1) / sizeof(*froms)];
+ &froms[((long)frompcindex) / (HASHFRACTION * sizeof(*froms))];
toindex = *frompcindex;
if (toindex == 0) {
/*
toindex = *frompcindex;
if (toindex == 0) {
/*