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]

[PATCH]: Fix zone collector PCH problems


I swear i've made this fix before :P.

Committed to mainline.

2003-12-01  Daniel Berlin  <dberlin@dberlin.org>

	* ggc-zone.c (ggc_pch_write_object): Calculate object size using
	ggc_get_size (which accounts for large objects properly).

Index: ggc-zone.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ggc-zone.c,v
retrieving revision 2.4
diff -u -3 -p -r2.4 ggc-zone.c
--- ggc-zone.c	21 Nov 2003 06:52:23 -0000	2.4
+++ ggc-zone.c	1 Dec 2003 17:53:14 -0000
@@ -1663,7 +1663,7 @@ ggc_pch_write_object (struct ggc_pch_dat
   if (!is_string)
     {
       struct alloc_chunk *chunk = (struct alloc_chunk *) ((char *)x - CHUNK_OVERHEAD);
-      size = chunk->size;
+      size = ggc_get_size (x);
       if (fwrite (chunk, size + CHUNK_OVERHEAD, 1, f) != 1)
 	fatal_error ("can't write PCH file: %m");
       d->written += size + CHUNK_OVERHEAD;


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