Commit 48cd6bc5 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Michael S. Tsirkin

virtio: Reorder fields in 'struct virtqueue'

Group some variables based on their sizes to reduce hole and avoid padding.
On x86_64, this shrinks the size of 'struct virtqueue'
from 72 to 68 bytes.

It saves a few bytes of memory.
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Message-Id: <8f3d2e49270a2158717e15008e7ed7228196ba02.1676707807.git.christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Acked-by: default avatarPeter Lafreniere <peter@n8pjl.ca>
Reviewed-by: default avatarStefano Garzarella <sgarzare@redhat.com>
parent e4be66e5
...@@ -34,8 +34,8 @@ struct virtqueue { ...@@ -34,8 +34,8 @@ struct virtqueue {
unsigned int index; unsigned int index;
unsigned int num_free; unsigned int num_free;
unsigned int num_max; unsigned int num_max;
void *priv;
bool reset; bool reset;
void *priv;
}; };
int virtqueue_add_outbuf(struct virtqueue *vq, int virtqueue_add_outbuf(struct virtqueue *vq,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment