This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[bib] Fix obvious mistake in my profiler patch


Hello,

there was a mistake in memory allocation in my profiler patch
(surprisingly, it never showed up through three weeks of testing).

Commited as obvious.

Zdenek

   * profile.c (index_counts_file): Fix obvious mistake.

Index: profile.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/profile.c,v
retrieving revision 1.97.4.6
diff -c -3 -p -r1.97.4.6 profile.c
*** profile.c	19 Nov 2002 16:42:43 -0000	1.97.4.6
--- profile.c	19 Nov 2002 20:07:48 -0000
*************** index_counts_file ()
*** 371,377 ****
  		    }
  		  (*slot)->n_offsets++;
  		  (*slot)->offsets = xrealloc ((*slot)->offsets,
! 					       sizeof (long) * (*slot)->n_offsets);
  		}
  	      else
  		{
--- 371,377 ----
  		    }
  		  (*slot)->n_offsets++;
  		  (*slot)->offsets = xrealloc ((*slot)->offsets,
! 					       sizeof (struct section_reference) * (*slot)->n_offsets);
  		}
  	      else
  		{
*************** index_counts_file ()
*** 380,386 ****
  		  (*slot)->section = tag;
  		  (*slot)->checksum = checksum;
  		  (*slot)->n_offsets = 1;
! 		  (*slot)->offsets = xmalloc (sizeof (long));
  		}
  	      (*slot)->offsets[(*slot)->n_offsets - 1].offset = offset;
  	      if (summary)
--- 380,386 ----
  		  (*slot)->section = tag;
  		  (*slot)->checksum = checksum;
  		  (*slot)->n_offsets = 1;
! 		  (*slot)->offsets = xmalloc (sizeof (struct section_reference));
  		}
  	      (*slot)->offsets[(*slot)->n_offsets - 1].offset = offset;
  	      if (summary)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]