From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37592) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHr2O-00008G-2w for qemu-devel@nongnu.org; Tue, 28 Jun 2016 07:18:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHr2J-0001iO-0s for qemu-devel@nongnu.org; Tue, 28 Jun 2016 07:18:38 -0400 Received: from mx-v6.kamp.de ([2a02:248:0:51::16]:49429 helo=mx01.kamp.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHr2I-0001hj-NN for qemu-devel@nongnu.org; Tue, 28 Jun 2016 07:18:34 -0400 References: <1467104499-27517-1-git-send-email-pl@kamp.de> <1467104499-27517-15-git-send-email-pl@kamp.de> <24c2e218-1451-26df-c3eb-31fae9eb3097@redhat.com> From: Peter Lieven Message-ID: <57725D06.4020703@kamp.de> Date: Tue, 28 Jun 2016 13:18:30 +0200 MIME-Version: 1.0 In-Reply-To: <24c2e218-1451-26df-c3eb-31fae9eb3097@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 14/15] vnc-tight: make the encoding palette static List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org Cc: kwolf@redhat.com, peter.maydell@linaro.org, mst@redhat.com, dgilbert@redhat.com, mreitz@redhat.com, kraxel@redhat.com Am 28.06.2016 um 13:12 schrieb Paolo Bonzini: > > On 28/06/2016 11:01, Peter Lieven wrote: >> @@ -201,6 +201,7 @@ typedef struct VncTight { >> #endif >> int levels[4]; >> z_stream stream[4]; >> + VncPalette palette; >> } VncTight; > VncTight is copied back and forth in vnc_async_encoding_start and > vnc_async_encoding_end, so this should not be included in VncTight. > Perhaps however if you include a VncPalette* it allows reuse and avoids > fragmentation? Or perhaps you can use a thread-local static variable? I will have look. I missed the copying. However, this palette is only used to count the number of distinct colors. So it should only be used in the encoding thread. Peter