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]

Re: [pph] Allocate string tables separately. (issue4843044)


On Fri, Aug 5, 2011 at 13:42,  <gchare@google.com> wrote:

> Yep this fixes the problem I had with the strings being freed early.

Great.

> http://codereview.appspot.com/4843044/diff/1/gcc/cp/pph-streamer-in.c#newcode157
> gcc/cp/pph-streamer-in.c:157: memcpy (new_strtab, strtab, strtab_size);
> I don't think we need to memcpy, to be more efficient instead we can
> just change the way stream->encoder.r.file_data is read to only read the
> pph_file_header + body into it, and fread the strtab straight into
> new_strtab.
>
> This implies more logic when reading, but is potentially more efficient.

Yeah, I thought about that, but I didn't want to make the file reading
logic more convoluted than it already is.  Maybe we can do that at
some later point.  And I think that the multiple read operations may
in fact be slower than memcpy'ing, but I didn't really try that.


Diego.


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