[BACK]Return to arcs.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / gprof

Diff for /src/usr.bin/gprof/arcs.c between version 1.12 and 1.13

version 1.12, 2009/10/27 23:59:38 version 1.13, 2015/08/20 22:32:41
Line 68 
Line 68 
         arcp -> arc_count += count;          arcp -> arc_count += count;
         return;          return;
     }      }
     arcp = (arctype *)calloc( 1 , sizeof *arcp );      arcp = calloc( 1 , sizeof *arcp );
     arcp -> arc_parentp = parentp;      arcp -> arc_parentp = parentp;
     arcp -> arc_childp = childp;      arcp -> arc_childp = childp;
     arcp -> arc_count = count;      arcp -> arc_count = count;
Line 189 
Line 189 
         /*          /*
          *      Sort the symbol table in reverse topological order           *      Sort the symbol table in reverse topological order
          */           */
     topsortnlp = (nltype **) calloc( nname , sizeof(nltype *) );      topsortnlp = calloc( nname , sizeof(nltype *) );
     if ( topsortnlp == (nltype **) 0 )      if ( topsortnlp == (nltype **) 0 )
         warnx("[doarcs] ran out of memory for topo sorting");          warnx("[doarcs] ran out of memory for topo sorting");
     for ( index = 0 ; index < nname ; index += 1 ) {      for ( index = 0 ; index < nname ; index += 1 ) {
Line 225 
Line 225 
          *      sorting both the regular function names           *      sorting both the regular function names
          *      and cycle headers.           *      and cycle headers.
          */           */
     timesortnlp = (nltype **) calloc( nname + ncycle , sizeof(nltype *) );      timesortnlp = calloc( nname + ncycle , sizeof(nltype *) );
     if ( timesortnlp == (nltype **) 0 )      if ( timesortnlp == (nltype **) 0 )
         warnx("ran out of memory for sorting");          warnx("ran out of memory for sorting");
     for ( index = 0 ; index < nname ; index++ ) {      for ( index = 0 ; index < nname ; index++ ) {
Line 364 
Line 364 
          *      cyclenl is indexed by cycle number:           *      cyclenl is indexed by cycle number:
          *      i.e. it is origin 1, not origin 0.           *      i.e. it is origin 1, not origin 0.
          */           */
     cyclenl = (nltype *) calloc( ncycle + 1 , sizeof( nltype ) );      cyclenl = calloc( ncycle + 1 , sizeof( nltype ) );
     if ( cyclenl == 0 )      if ( cyclenl == 0 )
         errx(0, "No room for %ld bytes of cycle headers",          errx(0, "No room for %ld bytes of cycle headers",
             (ncycle + 1) * sizeof(nltype));              (ncycle + 1) * sizeof(nltype));
Line 467 
Line 467 
         if ( size <= cyclethreshold )          if ( size <= cyclethreshold )
             continue;              continue;
         done = FALSE;          done = FALSE;
         cyclestack = (arctype **) calloc( size + 1 , sizeof( arctype *) );          cyclestack = calloc( size + 1 , sizeof( arctype *) );
         if ( cyclestack == 0 ) {          if ( cyclestack == 0 ) {
             warnx("No room for %ld bytes of cycle stack" ,              warnx("No room for %ld bytes of cycle stack" ,
                 (size + 1) * sizeof(arctype *));                  (size + 1) * sizeof(arctype *));
Line 581 
Line 581 
             return( TRUE );              return( TRUE );
         }          }
     }      }
     clp = (cltype *)      clp = calloc( 1 , sizeof ( cltype ) + ( size - 1 ) * sizeof( arctype * ) );
         calloc( 1 , sizeof ( cltype ) + ( size - 1 ) * sizeof( arctype * ) );  
     if ( clp == 0 ) {      if ( clp == 0 ) {
         warnx("No room for %ld bytes of subcycle storage" ,          warnx("No room for %ld bytes of subcycle storage" ,
             sizeof(cltype) + (size - 1) * sizeof(arctype *));              sizeof(cltype) + (size - 1) * sizeof(arctype *));

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13