From 021fea8f15b6a13a7cfe187ba93574abf4c679a8 Mon Sep 17 00:00:00 2001 From: marko <> Date: Fri, 26 Oct 2007 12:31:48 +0000 Subject: [PATCH] branches/zip: Add UNIV_UNLIKELY hints to help branch prediction. --- include/ut0lst.h | 4 ++-- rem/rem0rec.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/ut0lst.h b/include/ut0lst.h index ebe2803fe23..72ee85a79f0 100644 --- a/include/ut0lst.h +++ b/include/ut0lst.h @@ -73,12 +73,12 @@ the pointer to the node to be added to the list. NAME is the list name. */ ((BASE).count)++;\ ((N)->NAME).next = (BASE).start;\ ((N)->NAME).prev = NULL;\ - if ((BASE).start != NULL) {\ + if (UNIV_LIKELY((BASE).start != NULL)) {\ ut_ad((BASE).start != (N));\ (((BASE).start)->NAME).prev = (N);\ }\ (BASE).start = (N);\ - if ((BASE).end == NULL) {\ + if (UNIV_UNLIKELY((BASE).end == NULL)) {\ (BASE).end = (N);\ }\ }\ diff --git a/rem/rem0rec.c b/rem/rem0rec.c index d7f4d59fda3..07685eb34a5 100644 --- a/rem/rem0rec.c +++ b/rem/rem0rec.c @@ -533,7 +533,7 @@ rec_get_offsets_func( if (UNIV_UNLIKELY(!offsets) || UNIV_UNLIKELY(rec_offs_get_n_alloc(offsets) < size)) { - if (!*heap) { + if (UNIV_UNLIKELY(!*heap)) { *heap = mem_heap_create_func(size * sizeof(ulint), MEM_HEAP_DYNAMIC, file, line);