summaryrefslogtreecommitdiff
path: root/innobase/page
diff options
context:
space:
mode:
authorunknown <marko@hundin.mysql.fi>2005-04-21 14:23:26 +0300
committerunknown <marko@hundin.mysql.fi>2005-04-21 14:23:26 +0300
commit4e0e9a3bae62ea2a153052f96f4c0e7833e44c86 (patch)
tree6e2b22915d8470deefce93d6ed94427f8fa249bf /innobase/page
parentea5c2a148a6b704265324a2adcd7ae779a0df0b0 (diff)
downloadmariadb-git-4e0e9a3bae62ea2a153052f96f4c0e7833e44c86.tar.gz
InnoDB: Define some macros around GCC's __builtin_expect()
and __builtin_prefetch(). Add UNIV_LIKELY_NULL to if (heap) mem_free_heap(heap) tests. innobase/btr/btr0btr.c: Add UNIV_LIKELY_NULL to if (heap) mem_free_heap(heap) tests. innobase/btr/btr0cur.c: Add UNIV_LIKELY_NULL to if (heap) mem_free_heap(heap) tests. innobase/btr/btr0sea.c: Add UNIV_LIKELY_NULL to if (heap) mem_free_heap(heap) tests. innobase/include/univ.i: Define UNIV_EXPECT(), UNIV_LIKELY(), UNIV_UNLIKELY(), UNIV_LIKELY_NULL(), UNIV_PREFETCH_R() and UNIV_PREFETCH_RW(). innobase/lock/lock0lock.c: Add UNIV_LIKELY_NULL to if (heap) mem_free_heap(heap) tests. innobase/page/page0cur.c: Add UNIV_LIKELY_NULL to if (heap) mem_free_heap(heap) tests. innobase/page/page0page.c: Add UNIV_LIKELY_NULL to if (heap) mem_free_heap(heap) tests. innobase/rem/rem0rec.c: Add UNIV_LIKELY_NULL to if (heap) mem_free_heap(heap) tests. innobase/row/row0ins.c: Add UNIV_LIKELY_NULL to if (heap) mem_free_heap(heap) tests. innobase/row/row0mysql.c: Add UNIV_LIKELY_NULL to if (heap) mem_free_heap(heap) tests. innobase/row/row0purge.c: Add UNIV_LIKELY_NULL to if (heap) mem_free_heap(heap) tests. innobase/row/row0row.c: Add UNIV_LIKELY_NULL to if (heap) mem_free_heap(heap) tests. innobase/row/row0sel.c: Add UNIV_LIKELY_NULL to if (heap) mem_free_heap(heap) tests. innobase/row/row0undo.c: Add UNIV_LIKELY_NULL to if (heap) mem_free_heap(heap) tests. innobase/row/row0upd.c: Add UNIV_LIKELY_NULL to if (heap) mem_free_heap(heap) tests. innobase/trx/trx0rec.c: Add UNIV_LIKELY_NULL to if (heap) mem_free_heap(heap) tests.
Diffstat (limited to 'innobase/page')
-rw-r--r--innobase/page/page0cur.c16
-rw-r--r--innobase/page/page0page.c14
2 files changed, 15 insertions, 15 deletions
diff --git a/innobase/page/page0cur.c b/innobase/page/page0cur.c
index 7738f5a34f0..aade42c3a45 100644
--- a/innobase/page/page0cur.c
+++ b/innobase/page/page0cur.c
@@ -129,7 +129,7 @@ page_cur_try_search_shortcut(
#endif
success = TRUE;
exit_func:
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
return(success);
@@ -451,7 +451,7 @@ page_cur_search_with_match(
*iup_matched_bytes = up_matched_bytes;
*ilow_matched_fields = low_matched_fields;
*ilow_matched_bytes = low_matched_bytes;
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
}
@@ -539,7 +539,7 @@ page_cur_insert_rec_write_log(
ut_ad(rec_size == rec_offs_size(ins_offs));
cur_rec_size = rec_offs_size(cur_offs);
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
}
@@ -821,7 +821,7 @@ page_cur_parse_insert_rec(
mem_free(buf);
}
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
@@ -890,7 +890,7 @@ page_cur_insert_rec_low(
insert_buf = page_mem_alloc(page, rec_size, index, &heap_no);
if (insert_buf == NULL) {
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
return(NULL);
@@ -980,7 +980,7 @@ page_cur_insert_rec_low(
page_cur_insert_rec_write_log(insert_rec, rec_size, current_rec,
index, mtr);
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
return(insert_rec);
@@ -1186,7 +1186,7 @@ page_copy_rec_list_end_to_created_page(
slot_index--;
}
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
@@ -1285,7 +1285,7 @@ page_cur_parse_delete_rec(
page_cur_delete_rec(&cursor, index,
rec_get_offsets(rec, index, offsets_,
ULINT_UNDEFINED, &heap), mtr);
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
}
diff --git a/innobase/page/page0page.c b/innobase/page/page0page.c
index f3217e91f58..768444008b8 100644
--- a/innobase/page/page0page.c
+++ b/innobase/page/page0page.c
@@ -252,13 +252,13 @@ page_mem_alloc(
*heap_no = rec_get_heap_no(rec, page_is_comp(page));
block = rec_get_start(rec, offsets);
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
return(block);
}
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
}
@@ -514,7 +514,7 @@ page_copy_rec_list_end_no_locks(
page_cur_move_to_next(&cur2);
}
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
}
@@ -608,7 +608,7 @@ page_copy_rec_list_start(
btr_search_move_or_delete_hash_entries(new_page, page, index);
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
}
@@ -772,7 +772,7 @@ page_delete_rec_list_end(
rec2 = page_rec_get_next(rec2);
}
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
}
@@ -868,7 +868,7 @@ page_delete_rec_list_start(
page_cur_delete_rec(&cur1, index, offsets, mtr);
}
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
@@ -1381,7 +1381,7 @@ page_print_list(
"--------------------------------\n",
(ulong) (count + 1));
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
}