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: Peter Lieven
Subject: Re: [Qemu-devel] [PATCH 2/4] vnc: allow the Buffer to shrink again
Date: Thu, 3 Sep 2015 16:52:55 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0

Am 03.09.2015 um 13:52 schrieb Gerd Hoffmann:
   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.

Not completely. queue->buffer may remain big, if you disconnect in the
wrong moment. Maybe there should be a buffer_free if the last client
disconnects?

In general I like your modified patch because the shrinking is slower than
in my version. for 64*1024 you should introduce a macro.


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

Maybe this should be the permanent solution.

Peter



reply via email to

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