]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/audio/gus: skip automatic zero-init of large array
authorDaniel P. Berrangé <berrange@redhat.com>
Tue, 10 Jun 2025 12:36:48 +0000 (13:36 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Thu, 12 Jun 2025 17:39:08 +0000 (13:39 -0400)
The 'GUS_read_DMA' method has a 4k byte array used for copying
data between the audio backend and device. Skip the automatic
zero-init of this array to eliminate the performance overhead in
the I/O hot path.

The 'tmpbuf' array will be fully initialized when reading data
from device memory.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20250610123709.835102-11-berrange@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
hw/audio/gus.c

index 87e86348937315b6e5b33ff1fd999c10e927a3f2..c36df0240fe23cb89a56ad480fd9e10a1d918adf 100644 (file)
@@ -183,7 +183,7 @@ static int GUS_read_DMA (void *opaque, int nchan, int dma_pos, int dma_len)
 {
     GUSState *s = opaque;
     IsaDmaClass *k = ISADMA_GET_CLASS(s->isa_dma);
-    char tmpbuf[4096];
+    QEMU_UNINITIALIZED char tmpbuf[4096];
     int pos = dma_pos, mode, left = dma_len - dma_pos;
 
     ldebug ("read DMA %#x %d\n", dma_pos, dma_len);