summaryrefslogtreecommitdiff
path: root/storage/xtradb/page
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2015-05-11 14:29:14 +0300
committerJan Lindström <jan.lindstrom@mariadb.com>2015-05-11 14:31:42 +0300
commit58e8db2eb398a812e2894d28db4173a4f67fea06 (patch)
treed46891529e0cd7db1eb36acae5d099035d95c7b0 /storage/xtradb/page
parent6e4920164426543082d02cde4c60bd29cbd54f99 (diff)
downloadmariadb-git-58e8db2eb398a812e2894d28db4173a4f67fea06.tar.gz
MDEV-7942: InnoDB: abuse of UNIV_LIKELY()/UNIV_UNLIKELY()
UNIV_LIKELY()/UNIV_UNLIKELY() hints are supposed to improve branch prediction. Currently, they're expected to work only if cond evaluates to TRUE or FALSE. However there're a few conditions that may evaluate to different values, e.g.: page/page0zip.cc: if (UNIV_LIKELY(c_stream->avail_in)) { page/page0zip.cc: if (UNIV_LIKELY(c_stream->avail_in)) { dict/dict0mem.cc: if (UNIV_LIKELY(i) && UNIV_UNLIKELY(!table->col_names)) { Fixed these conditions so that they evaluate TRUE/FALSE.
Diffstat (limited to 'storage/xtradb/page')
-rw-r--r--storage/xtradb/page/page0zip.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/storage/xtradb/page/page0zip.cc b/storage/xtradb/page/page0zip.cc
index 9ad39147d0d..86c33ab5efb 100644
--- a/storage/xtradb/page/page0zip.cc
+++ b/storage/xtradb/page/page0zip.cc
@@ -912,7 +912,7 @@ page_zip_compress_sec(
rec - REC_N_NEW_EXTRA_BYTES
- c_stream->next_in);
- if (UNIV_LIKELY(c_stream->avail_in)) {
+ if (UNIV_LIKELY(c_stream->avail_in != 0)) {
UNIV_MEM_ASSERT_RW(c_stream->next_in,
c_stream->avail_in);
err = deflate(c_stream, Z_NO_FLUSH);
@@ -1007,7 +1007,7 @@ page_zip_compress_clust_ext(
c_stream->avail_in = static_cast<uInt>(
src - c_stream->next_in);
- if (UNIV_LIKELY(c_stream->avail_in)) {
+ if (UNIV_LIKELY(c_stream->avail_in != 0)) {
err = deflate(c_stream, Z_NO_FLUSH);
if (UNIV_UNLIKELY(err != Z_OK)) {