From: Anthony Liguori <aliguori@linux.vnet.ibm.com>
To: Corentin Chary <corentincj@iksaif.net>
Cc: "Bruce Rogers" <brogers@novell.com>,
"Stefan Hajnoczi" <stefanha@gmail.com>,
qemu-devel@nongnu.org, "Alexander Graf" <agraf@suse.de>,
"Blue Swirl" <blauwirbel@gmail.com>,
"Torsten Förtsch" <torsten.foertsch@gmx.net>
Subject: Re: [Qemu-devel] [PATCH] vnc: fix a memory leak in threaded vnc server
Date: Fri, 25 Feb 2011 16:50:04 -0600 [thread overview]
Message-ID: <4D68321C.90800@linux.vnet.ibm.com> (raw)
In-Reply-To: <1298670893-15157-1-git-send-email-corentincj@iksaif.net>
On 02/25/2011 03:54 PM, Corentin Chary wrote:
> VncJobQueue's buffer is intended to be used for
> as the output buffer for all operations in this queue,
> but unfortunatly.
>
> vnc_async_encoding_start() is in charge of setting this
> buffer as the current output buffer, but
> vnc_async_encoding_end() was not writting the changes back
> to VncJobQueue, resulting in a big and ugly memleak.
>
> Signed-off-by: Corentin Chary<corentincj@iksaif.net>
>
Applied. Thanks.
Regards,
Anthony Liguori
> ---
> I believe this is a (slightly) better patch than Bruce's one, because
> it reduce memory allocations by using always the same buffer.
>
> ui/vnc-jobs-async.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/ui/vnc-jobs-async.c b/ui/vnc-jobs-async.c
> index 1d4c5e7..f596247 100644
> --- a/ui/vnc-jobs-async.c
> +++ b/ui/vnc-jobs-async.c
> @@ -186,6 +186,8 @@ static void vnc_async_encoding_end(VncState *orig, VncState *local)
> orig->hextile = local->hextile;
> orig->zrle = local->zrle;
> orig->lossy_rect = local->lossy_rect;
> +
> + queue->buffer = local->output;
> }
>
> static int vnc_worker_thread_loop(VncJobQueue *queue)
>
prev parent reply other threads:[~2011-02-25 22:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <D6799E202000048000AA8EC@novprvoes0310.provo.novell.com>
2011-02-25 21:54 ` [Qemu-devel] [PATCH] vnc: fix a memory leak in threaded vnc server Corentin Chary
2011-02-25 22:50 ` Anthony Liguori [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D68321C.90800@linux.vnet.ibm.com \
--to=aliguori@linux.vnet.ibm.com \
--cc=agraf@suse.de \
--cc=blauwirbel@gmail.com \
--cc=brogers@novell.com \
--cc=corentincj@iksaif.net \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
--cc=torsten.foertsch@gmx.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.