summaryrefslogtreecommitdiff
path: root/innobase/btr
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/btr
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/btr')
-rw-r--r--innobase/btr/btr0btr.c12
-rw-r--r--innobase/btr/btr0cur.c26
-rw-r--r--innobase/btr/btr0sea.c14
3 files changed, 26 insertions, 26 deletions
diff --git a/innobase/btr/btr0btr.c b/innobase/btr/btr0btr.c
index fe6220b860d..961b9eb696d 100644
--- a/innobase/btr/btr0btr.c
+++ b/innobase/btr/btr0btr.c
@@ -1284,14 +1284,14 @@ btr_page_get_sure_split_rec(
next_rec = page_rec_get_next(rec);
}
if (next_rec != page_get_supremum_rec(page)) {
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
return(next_rec);
}
}
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
return(rec);
@@ -2109,7 +2109,7 @@ btr_compress(
rec_get_offsets(node_ptr, cursor->index,
offsets_, ULINT_UNDEFINED, &heap),
right_page_no, mtr);
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
btr_node_ptr_delete(tree, merge_page, mtr);
@@ -2403,7 +2403,7 @@ btr_print_tree(
root = btr_root_get(tree, &mtr);
btr_print_recursive(tree, root, width, &heap, &offsets, &mtr);
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
@@ -2557,14 +2557,14 @@ btr_index_rec_validate(
rec_print_new(stderr, rec, offsets);
putc('\n', stderr);
}
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
return(FALSE);
}
}
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
return(TRUE);
diff --git a/innobase/btr/btr0cur.c b/innobase/btr/btr0cur.c
index d7342c8bff5..80a2600c7f9 100644
--- a/innobase/btr/btr0cur.c
+++ b/innobase/btr/btr0cur.c
@@ -431,7 +431,7 @@ retry_page_get:
cursor->thr)) {
/* Insertion to the insert buffer succeeded */
cursor->flag = BTR_CUR_INSERT_TO_IBUF;
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
return;
@@ -525,7 +525,7 @@ retry_page_get:
page_no = btr_node_ptr_get_child_page_no(node_ptr, offsets);
}
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
@@ -681,7 +681,7 @@ btr_cur_open_at_index_side(
page_no = btr_node_ptr_get_child_page_no(node_ptr, offsets);
}
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
}
@@ -762,7 +762,7 @@ btr_cur_open_at_rnd_pos(
page_no = btr_node_ptr_get_child_page_no(node_ptr, offsets);
}
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
}
@@ -1261,7 +1261,7 @@ btr_cur_upd_lock_and_undo(
err = lock_clust_rec_modify_check_and_lock(flags, rec, index,
rec_get_offsets(rec, index, offsets_,
ULINT_UNDEFINED, &heap), thr);
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
if (err != DB_SUCCESS) {
@@ -1451,7 +1451,7 @@ btr_cur_update_in_place(
thr, &roll_ptr);
if (err != DB_SUCCESS) {
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
return(err);
@@ -1498,7 +1498,7 @@ btr_cur_update_in_place(
btr_cur_unmark_extern_fields(rec, mtr, offsets);
}
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
return(DB_SUCCESS);
@@ -2078,7 +2078,7 @@ btr_cur_parse_del_mark_set_clust_rec(
rec_get_offsets(rec, index, offsets_,
ULINT_UNDEFINED, &heap),
pos, trx_id, roll_ptr);
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
}
@@ -2138,7 +2138,7 @@ btr_cur_del_mark_set_clust_rec(
if (err != DB_SUCCESS) {
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
return(err);
@@ -2149,7 +2149,7 @@ btr_cur_del_mark_set_clust_rec(
&roll_ptr);
if (err != DB_SUCCESS) {
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
return(err);
@@ -2175,7 +2175,7 @@ btr_cur_del_mark_set_clust_rec(
btr_cur_del_mark_set_clust_rec_log(flags, rec, index, val, trx,
roll_ptr, mtr);
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
return(DB_SUCCESS);
@@ -2443,7 +2443,7 @@ btr_cur_optimistic_delete(
mtr);
}
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
@@ -2943,7 +2943,7 @@ btr_estimate_number_of_different_key_vals(
}
mem_free(n_diff);
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
}
diff --git a/innobase/btr/btr0sea.c b/innobase/btr/btr0sea.c
index 97fdce2df75..cb43876e303 100644
--- a/innobase/btr/btr0sea.c
+++ b/innobase/btr/btr0sea.c
@@ -435,7 +435,7 @@ btr_search_update_hash_ref(
offsets_, ULINT_UNDEFINED, &heap),
block->curr_n_fields,
block->curr_n_bytes, tree_id);
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
#ifdef UNIV_SYNC_DEBUG
@@ -659,7 +659,7 @@ btr_search_check_guess(
success = cmp != 1;
}
exit_func:
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
return(success);
@@ -1010,7 +1010,7 @@ next_rec:
prev_fold = fold;
}
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
@@ -1252,7 +1252,7 @@ exit_func:
mem_free(folds);
mem_free(recs);
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
}
@@ -1370,7 +1370,7 @@ btr_search_update_hash_on_delete(
fold = rec_fold(rec, rec_get_offsets(rec, cursor->index, offsets_,
ULINT_UNDEFINED, &heap), block->curr_n_fields,
block->curr_n_bytes, tree_id);
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
rw_lock_x_lock(&btr_search_latch);
@@ -1573,7 +1573,7 @@ check_next_rec:
}
function_exit:
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
if (locked) {
@@ -1662,7 +1662,7 @@ btr_search_validate(void)
}
rw_lock_x_unlock(&btr_search_latch);
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}