• Frediano Ziglio's avatar
    stats: Avoid holes in SpiceStat structure · f6e4cb65
    Frediano Ziglio authored
    The SpiceStat structure can be 20 or 24 bytes depending on alignment.
    Being a memory mapped structure potentially used with lockless access,
    it is not good to have it unaligned.
    The only tool that we know of that reads this memory mapped file
    (reds_stats) is able to detect if the structure is either 20 or 24
    bytes and act accordingly so changing this structure won't affect the
    behaviour (unless you have an old tool but as they are usually
    packaged together this is quite improbable).
    This will also help on Windows as in that system it is not possible
    for reds_stats to implement the same discovery trick implemented on
    Linux.  On Windows it is not possible to read the size of the file
    mapping (on Windows to implement shared memory you can use a file
    mapping not associated to a file).
    The structure will change layout only on 32-bit architectures which is
    not recommended nowadays (the 64-bit platforms that we support align
    64-bit integers to 64 bits).
    Signed-off-by: Frediano Ziglio's avatarFrediano Ziglio <fziglio@redhat.com>
    Acked-by: Christophe Fergeau's avatarChristophe Fergeau <cfergeau@redhat.com>
    f6e4cb65
Name
Last commit
Last update
m4 Loading commit data...
spice Loading commit data...
AUTHORS Loading commit data...
COPYING Loading commit data...
ChangeLog Loading commit data...
Makefile.am Loading commit data...
NEWS Loading commit data...
README Loading commit data...
autogen.sh Loading commit data...
configure.ac Loading commit data...
git.mk Loading commit data...
meson.build Loading commit data...
spice-protocol.pc.in Loading commit data...