qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 18/23] ui/vnc-enc-hextile: Use definitions to avoid dynamic s


From: Richard Henderson
Subject: Re: [PATCH 18/23] ui/vnc-enc-hextile: Use definitions to avoid dynamic stack allocation
Date: Fri, 7 May 2021 09:46:27 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1

On 5/5/21 2:10 PM, Philippe Mathieu-Daudé wrote:
We know 'pf.bytes_per_pixel' will be at most 'VNC_SERVER_FB_BYTES'
(which is actually 4 bytes for 32bpp). Instead of having the compiler
use variable-length array, use this 'small' maximum length and
autofree to allocate the buffer on the heap.

Signed-off-by: Philippe Mathieu-Daudé<philmd@redhat.com>
---
  ui/vnc-enc-hextile-template.h | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

Wait, you know the value is small (max 4), and you don't want to allocate a constant 1k on the stack?


r~



reply via email to

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