[CRIU] Re: [PATCH] protobuf: Convert vma_entry to PB format v2

Cyrill Gorcunov gorcunov at openvz.org
Thu Jul 19 04:18:46 EDT 2012


On Thu, Jul 19, 2012 at 12:16:47PM +0400, Cyrill Gorcunov wrote:
> > >         while (1) {
> > > -               ret = read_img_eof(fd, &vi);
> > > +               ret = pb_read_eof(fd, &tmp, vma_entry);
> > >                 if (ret <= 0)
> > >                         break;
> > > 
> > > +               /*
> > > +                * FIXME Optimize reading the messages which
> > > +                * have constant size.
> > > +                */
> > > +               vi = *tmp;
> > > +               vma_entry__free_unpacked(tmp, NULL);
> > > +
> > 
> > Huh? Why not just use tmp below?
> 
> It makes patch smaller and btw, it doesn't make _much_ sense
> since both variables are referenced in code and you'll get
> no speed up if tmp referenced here instead.

Pavel, I thought about other snippet while replying on this complain.
I'll update and send patch.

	Cyrill


More information about the CRIU mailing list