worker: RedCompressBuf optimization

Move large buffer field at the end of structure.
Due to the way machine address memory this usually can reduce code size
and make program sligthly faster.
Actually reduce size by 100 bytes.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
This commit is contained in:
Frediano Ziglio 2015-08-29 19:53:42 +01:00
parent 03ff0dcef9
commit 435daaffdb

View File

@ -58,6 +58,8 @@ void glz_retention_detach_drawables(GlzImageRetention *ret);
#define RED_COMPRESS_BUF_SIZE (1024 * 64)
struct RedCompressBuf {
RedCompressBuf *send_next;
/* This buffer provide space for compression algorithms.
* Some algorithms access the buffer as an array of 32 bit words
* so is defined to make sure is always aligned that way.
@ -66,7 +68,6 @@ struct RedCompressBuf {
uint8_t bytes[RED_COMPRESS_BUF_SIZE];
uint32_t words[RED_COMPRESS_BUF_SIZE / 4];
} buf;
RedCompressBuf *send_next;
};
static inline void compress_buf_free(RedCompressBuf *buf)