This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH]: Fix zone collector PCH problems
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 1 Dec 2003 12:56:06 -0500 (EST)
- Subject: [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;