This is the mail archive of the gcc@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]

Re: PCH assumes there is no information before the object


Daniel Berlin <dberlin@dberlin.org> writes:

> I'm implementing PCH for the new zone collector in my spare
> time, and currently, PCH assumes it can simply read in the object at the correct
> address, and that will put everything right.
> This may work for ggc-page, but it won't work for ggc-simple (which has
> no PCH implemented), or the new zone collector.  This is because both put
> information before ggc allocated objects.
> 
> There seems to be no way to support this without significantly modifying
> the PCH reading/writing machinery, which assumes it only has to write the
> object out.
>
> I can't even just make a table of the object header info, and write it
> out in the zone collector, because we'd still need to put it before each
> object, which we have no hook for.
> 
> Geoff, have i missed something?

I believe you can easily handle this using the current machinery.
ggc_pch_write_object would write out the header for the current
object, then the object, then enough padding to go up to the place
where it will write out the next object's header.  You do not have to
keep the file pointer positioned at the place where the next object's
data will be.

Of course, ggc_pch_count_object and ggc_pch_alloc_object will have to
allow for the header in their calculations.

That was how I'd planned to implement ggc-simple PCH.

-- 
- Geoffrey Keating <geoffk@geoffk.org>


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