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

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).

From-SVN: r74114
This commit is contained in:
Daniel Berlin 2003-12-01 17:58:13 +00:00 committed by Daniel Berlin
parent fccab17ead
commit 7297afa029
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
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).
2003-12-01 Jeff Sturm <jsturm@one-point.com>
PR optimization/13024

View File

@ -1663,7 +1663,7 @@ ggc_pch_write_object (struct ggc_pch_data *d ATTRIBUTE_UNUSED,
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;