[Spice-commits] common/quic.c
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon May 28 10:28:21 UTC 2018
common/quic.c | 23 ++---------------------
1 file changed, 2 insertions(+), 21 deletions(-)
New commits:
commit 160232f8f6618763a80bed74c76167beb8361ab6
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Fri May 25 16:49:09 2018 +0100
quic: Remove 'no-inline' hack
The quic code goes through a function pointer in two places in order to
try to prevent the compiler from inlining code.
Doing performance measurements this trick does not work anymore
and just make code less readable.
This patch and message was based on a previous work of
Christophe Fergeau.
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Victor Toso <victortoso at redhat.com>
diff --git a/common/quic.c b/common/quic.c
index 12e9b0b..a9a82ba 100644
--- a/common/quic.c
+++ b/common/quic.c
@@ -388,19 +388,10 @@ static void more_io_words(Encoder *encoder)
encoder->io_end = encoder->io_now + num_io_words;
}
-static void __write_io_word(Encoder *encoder)
-{
- more_io_words(encoder);
- *(encoder->io_now++) = encoder->io_word;
-}
-
-static void (*__write_io_word_ptr)(Encoder *encoder) = __write_io_word;
-
static inline void write_io_word(Encoder *encoder)
{
if (encoder->io_now == encoder->io_end) {
- __write_io_word_ptr(encoder); //disable inline optimizations
- return;
+ more_io_words(encoder);
}
*(encoder->io_now++) = encoder->io_word;
}
@@ -441,20 +432,10 @@ static inline void flush(Encoder *encoder)
encode(encoder, 0, 1);
}
-static void __read_io_word(Encoder *encoder)
-{
- more_io_words(encoder);
- encoder->io_next_word = GUINT32_FROM_LE(*(encoder->io_now++));
-}
-
-static void (*__read_io_word_ptr)(Encoder *encoder) = __read_io_word;
-
-
static inline void read_io_word(Encoder *encoder)
{
if (encoder->io_now == encoder->io_end) {
- __read_io_word_ptr(encoder); //disable inline optimizations
- return;
+ more_io_words(encoder);
}
spice_assert(encoder->io_now < encoder->io_end);
encoder->io_next_word = GUINT32_FROM_LE(*(encoder->io_now++));
More information about the Spice-commits
mailing list