qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/4] vnc: allow the Buffer to shrink again


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH 2/4] vnc: allow the Buffer to shrink again
Date: Thu, 03 Sep 2015 13:52:11 +0200

  Hi,

> > Beside that I think it makes sense to have the shrinking logic in
> > buffer_reserve too so we don't have to add buffer_shrink calls all over
> > the place.
> 
> We need a possibility to shrink the buffer after it has been used.
> Especially the queue->buffer.

That works fine.  Test patch attached.

I'm not sure this is the way to go though.  I see alot of growing and
shrinking.  We also do alot of coping (each realloc, but also from
buffer to buffer).

We might be better off redoing the whole buffer management, at least
once we are done with encoding one frame.  Passing on a *pointer* to the
buffer, once sent to the wire just free the buffer.  Allocate a new one
for the next frame.  That way we copy around less data and also don't
have to worry about big unused buffers in the first place ...

cheers,
  Gerd

Attachment: 0001-test-buffer-shrink-in-buffer_reserve.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]