List:Internals« Previous MessageNext Message »
From:Marko Mäkelä Date:April 21 2005 11:23am
Subject:bk commit into 5.0 tree (marko:1.1853)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of marko. When marko does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.1853 05/04/21 14:23:26 marko@stripped +16 -0
  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/trx/trx0rec.c
    1.21 05/04/21 14:23:18 marko@stripped +2 -2
    Add UNIV_LIKELY_NULL to if (heap) mem_free_heap(heap) tests.

  innobase/row/row0upd.c
    1.35 05/04/21 14:23:18 marko@stripped +6 -6
    Add UNIV_LIKELY_NULL to if (heap) mem_free_heap(heap) tests.

  innobase/row/row0undo.c
    1.14 05/04/21 14:23:18 marko@stripped +1 -1
    Add UNIV_LIKELY_NULL to if (heap) mem_free_heap(heap) tests.

  innobase/row/row0sel.c
    1.88 05/04/21 14:23:18 marko@stripped +5 -5
    Add UNIV_LIKELY_NULL to if (heap) mem_free_heap(heap) tests.

  innobase/row/row0row.c
    1.19 05/04/21 14:23:18 marko@stripped +1 -1
    Add UNIV_LIKELY_NULL to if (heap) mem_free_heap(heap) tests.

  innobase/row/row0purge.c
    1.22 05/04/21 14:23:17 marko@stripped +2 -2
    Add UNIV_LIKELY_NULL to if (heap) mem_free_heap(heap) tests.

  innobase/row/row0mysql.c
    1.106 05/04/21 14:23:17 marko@stripped +1 -1
    Add UNIV_LIKELY_NULL to if (heap) mem_free_heap(heap) tests.

  innobase/row/row0ins.c
    1.66 05/04/21 14:23:17 marko@stripped +3 -3
    Add UNIV_LIKELY_NULL to if (heap) mem_free_heap(heap) tests.

  innobase/rem/rem0rec.c
    1.16 05/04/21 14:23:17 marko@stripped +2 -2
    Add UNIV_LIKELY_NULL to if (heap) mem_free_heap(heap) tests.

  innobase/page/page0page.c
    1.28 05/04/21 14:23:17 marko@stripped +7 -7
    Add UNIV_LIKELY_NULL to if (heap) mem_free_heap(heap) tests.

  innobase/page/page0cur.c
    1.24 05/04/21 14:23:17 marko@stripped +8 -8
    Add UNIV_LIKELY_NULL to if (heap) mem_free_heap(heap) tests.

  innobase/lock/lock0lock.c
    1.56 05/04/21 14:23:17 marko@stripped +4 -4
    Add UNIV_LIKELY_NULL to if (heap) mem_free_heap(heap) tests.

  innobase/include/univ.i
    1.41 05/04/21 14:23:17 marko@stripped +14 -0
    Define UNIV_EXPECT(), UNIV_LIKELY(), UNIV_UNLIKELY(),
    UNIV_LIKELY_NULL(), UNIV_PREFETCH_R() and UNIV_PREFETCH_RW().

  innobase/btr/btr0sea.c
    1.31 05/04/21 14:23:17 marko@stripped +7 -7
    Add UNIV_LIKELY_NULL to if (heap) mem_free_heap(heap) tests.

  innobase/btr/btr0cur.c
    1.46 05/04/21 14:23:17 marko@stripped +13 -13
    Add UNIV_LIKELY_NULL to if (heap) mem_free_heap(heap) tests.

  innobase/btr/btr0btr.c
    1.40 05/04/21 14:23:17 marko@stripped +6 -6
    Add UNIV_LIKELY_NULL to if (heap) mem_free_heap(heap) tests.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	marko
# Host:	hundin.mysql.fi
# Root:	/home/marko/mysql-5.0

--- 1.39/innobase/btr/btr0btr.c	Wed Apr 20 17:38:56 2005
+++ 1.40/innobase/btr/btr0btr.c	Thu Apr 21 14:23:17 2005
@@ -1284,14 +1284,14 @@
 					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 @@
 				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 @@
 	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 @@
 				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);			

--- 1.45/innobase/btr/btr0cur.c	Mon Apr 18 15:12:21 2005
+++ 1.46/innobase/btr/btr0cur.c	Thu Apr 21 14:23:17 2005
@@ -431,7 +431,7 @@
 							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 @@
 		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 @@
 		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 @@
 		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 @@
 		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 @@
 							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_unmark_extern_fields(rec, mtr, offsets);
 	}
 
-	if (heap) {
+	if (UNIV_LIKELY_NULL(heap)) {
 		mem_heap_free(heap);
 	}
 	return(DB_SUCCESS);
@@ -2078,7 +2078,7 @@
 					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 @@
 
 	if (err != DB_SUCCESS) {
 
-		if (heap) {
+		if (UNIV_LIKELY_NULL(heap)) {
 			mem_heap_free(heap);
 		}
 		return(err);
@@ -2149,7 +2149,7 @@
 						&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_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 @@
 									mtr);
 	}
 
-	if (heap) {
+	if (UNIV_LIKELY_NULL(heap)) {
 		mem_heap_free(heap);
 	}
 
@@ -2943,7 +2943,7 @@
 	}
 		
 	mem_free(n_diff);
-	if (heap) {
+	if (UNIV_LIKELY_NULL(heap)) {
 		mem_heap_free(heap);
 	}
 }

--- 1.30/innobase/btr/btr0sea.c	Thu Mar 10 15:15:59 2005
+++ 1.31/innobase/btr/btr0sea.c	Thu Apr 21 14:23:17 2005
@@ -435,7 +435,7 @@
 				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 @@
 		success = cmp != 1;
 	}
 exit_func:
-	if (heap) {
+	if (UNIV_LIKELY_NULL(heap)) {
 		mem_heap_free(heap);
 	}
 	return(success);
@@ -1010,7 +1010,7 @@
 		prev_fold = fold;
 	}
 
-	if (heap) {
+	if (UNIV_LIKELY_NULL(heap)) {
 		mem_heap_free(heap);
 	}
 
@@ -1252,7 +1252,7 @@
 
 	mem_free(folds);
 	mem_free(recs);
-	if (heap) {
+	if (UNIV_LIKELY_NULL(heap)) {
 		mem_heap_free(heap);
 	}
 }
@@ -1370,7 +1370,7 @@
 	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 @@
 	}	
 		
 function_exit:
-	if (heap) {
+	if (UNIV_LIKELY_NULL(heap)) {
 		mem_heap_free(heap);
 	}
 	if (locked) {
@@ -1662,7 +1662,7 @@
 	}
 
 	rw_lock_x_unlock(&btr_search_latch);
-	if (heap) {
+	if (UNIV_LIKELY_NULL(heap)) {
 		mem_heap_free(heap);
 	}
 

--- 1.40/innobase/include/univ.i	Wed Feb  2 22:50:28 2005
+++ 1.41/innobase/include/univ.i	Thu Apr 21 14:23:17 2005
@@ -243,6 +243,20 @@
 
 #define UNIV_EXTERN_STORAGE_FIELD (UNIV_SQL_NULL - UNIV_PAGE_SIZE)
 
+#if defined(__GNUC__) && (__GNUC__ > 2)
+# define UNIV_EXPECT(expr,value) __builtin_expect(expr, value)
+# define UNIV_LIKELY_NULL(expr) __builtin_expect((ulint) expr, 0)
+# define UNIV_PREFETCH_R(addr) __builtin_prefetch(addr, 0, 3)
+# define UNIV_PREFETCH_RW(addr) __builtin_prefetch(addr, 1, 3)
+#else
+# define UNIV_EXPECT(expr,value) (expr)
+# define UNIV_LIKELY_NULL(expr) (expr)
+# define UNIV_PREFETCH_R(addr) ((void) 0)
+# define UNIV_PREFETCH_RW(addr) ((void) 0)
+#endif
+#define UNIV_LIKELY(expr) UNIV_EXPECT(expr, TRUE)
+#define UNIV_UNLIKELY(expr) UNIV_EXPECT(expr, FALSE)
+
 #include <stdio.h>
 #include "ut0dbg.h"
 #include "ut0ut.h"

--- 1.55/innobase/lock/lock0lock.c	Thu Mar 10 15:15:59 2005
+++ 1.56/innobase/lock/lock0lock.c	Thu Apr 21 14:23:17 2005
@@ -4187,7 +4187,7 @@
 	}
 
 	mtr_commit(&mtr);
-	if (heap) {
+	if (UNIV_LIKELY_NULL(heap)) {
 		mem_heap_free(heap);
 	}
 }
@@ -4664,7 +4664,7 @@
 
 	mtr_commit(&mtr);
 
-	if (heap) {
+	if (UNIV_LIKELY_NULL(heap)) {
 		mem_heap_free(heap);
 	}
 	return(TRUE);
@@ -4850,7 +4850,7 @@
 		offsets = rec_get_offsets(next_rec, index, offsets_,
 						ULINT_UNDEFINED, &heap);
 		ut_ad(lock_rec_queue_validate(next_rec, index, offsets));
-		if (heap) {
+		if (UNIV_LIKELY_NULL(heap)) {
 			mem_heap_free(heap);
 		}
 	}
@@ -4999,7 +4999,7 @@
 		offsets = rec_get_offsets(rec, index, offsets_,
 						ULINT_UNDEFINED, &heap);
 		ut_ad(lock_rec_queue_validate(rec, index, offsets));
-		if (heap) {
+		if (UNIV_LIKELY_NULL(heap)) {
 			mem_heap_free(heap);
 		}
 	}

--- 1.23/innobase/page/page0cur.c	Thu Mar 10 15:16:00 2005
+++ 1.24/innobase/page/page0cur.c	Thu Apr 21 14:23:17 2005
@@ -129,7 +129,7 @@
 #endif
 	success = TRUE;
 exit_func:
-	if (heap) {
+	if (UNIV_LIKELY_NULL(heap)) {
 		mem_heap_free(heap);
 	}
 	return(success);
@@ -451,7 +451,7 @@
 	*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 @@
 		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 @@
 		mem_free(buf);
 	}
 
-	if (heap) {
+	if (UNIV_LIKELY_NULL(heap)) {
 		mem_heap_free(heap);
 	}
 
@@ -890,7 +890,7 @@
 	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_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 @@
 		slot_index--;
 	}
 
-	if (heap) {
+	if (UNIV_LIKELY_NULL(heap)) {
 		mem_heap_free(heap);
 	}
 
@@ -1285,7 +1285,7 @@
 		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);
 		}
 	}

--- 1.27/innobase/page/page0page.c	Thu Mar 10 15:16:00 2005
+++ 1.28/innobase/page/page0page.c	Thu Apr 21 14:23:17 2005
@@ -252,13 +252,13 @@
 			*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_cur_move_to_next(&cur2);
 	}
 
-	if (heap) {
+	if (UNIV_LIKELY_NULL(heap)) {
 		mem_heap_free(heap);
 	}
 }
@@ -608,7 +608,7 @@
 
 	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 @@
 			rec2 = page_rec_get_next(rec2);
 		}
 
-		if (heap) {
+		if (UNIV_LIKELY_NULL(heap)) {
 			mem_heap_free(heap);
 		}
 	}
@@ -868,7 +868,7 @@
 		page_cur_delete_rec(&cur1, index, offsets, mtr);
 	}
 
-	if (heap) {
+	if (UNIV_LIKELY_NULL(heap)) {
 		mem_heap_free(heap);
 	}
 
@@ -1381,7 +1381,7 @@
 		"--------------------------------\n",
 		(ulong) (count + 1));
 
-	if (heap) {
+	if (UNIV_LIKELY_NULL(heap)) {
 		mem_heap_free(heap);
 	}
 }	

--- 1.15/innobase/rem/rem0rec.c	Thu Mar 10 15:16:00 2005
+++ 1.16/innobase/rem/rem0rec.c	Thu Apr 21 14:23:17 2005
@@ -965,7 +965,7 @@
 		offsets = rec_get_offsets(rec, index,
 					offsets_, ULINT_UNDEFINED, &heap);
 		ut_ad(rec_validate(rec, offsets));
-		if (heap) {
+		if (UNIV_LIKELY_NULL(heap)) {
 			mem_heap_free(heap);
 		}
 	}
@@ -1412,7 +1412,7 @@
 
 		rec_print_new(file, rec, rec_get_offsets(rec, index, offsets_,
 						ULINT_UNDEFINED, &heap));
-		if (heap) {
+		if (UNIV_LIKELY_NULL(heap)) {
 			mem_heap_free(heap);
 		}
 	}

--- 1.65/innobase/row/row0ins.c	Wed Mar 16 00:00:57 2005
+++ 1.66/innobase/row/row0ins.c	Thu Apr 21 14:23:17 2005
@@ -1392,7 +1392,7 @@
 	}
 
 exit_func:
-	if (heap) {
+	if (UNIV_LIKELY_NULL(heap)) {
 		mem_heap_free(heap);
 	}
 	return(err);
@@ -1660,7 +1660,7 @@
 		}
 	}
 
-	if (heap) {
+	if (UNIV_LIKELY_NULL(heap)) {
 		mem_heap_free(heap);
 	}
 	mtr_commit(&mtr);
@@ -2048,7 +2048,7 @@
 		mtr_commit(&mtr);
 	}
 
-	if (heap) {
+	if (UNIV_LIKELY_NULL(heap)) {
 		mem_heap_free(heap);
 	}
 	return(err);

--- 1.105/innobase/row/row0mysql.c	Wed Apr 20 17:38:56 2005
+++ 1.106/innobase/row/row0mysql.c	Thu Apr 21 14:23:17 2005
@@ -3845,7 +3845,7 @@
 		que_graph_free(graph);
 	}
 
-	if (heap) {
+	if (UNIV_LIKELY_NULL(heap)) {
 		mem_heap_free(heap);
 	}
 	

--- 1.21/innobase/row/row0purge.c	Thu Mar 10 15:16:00 2005
+++ 1.22/innobase/row/row0purge.c	Thu Apr 21 14:23:17 2005
@@ -126,7 +126,7 @@
 	if (0 != ut_dulint_cmp(node->roll_ptr,
 		row_get_rec_roll_ptr(rec, index, rec_get_offsets(
 			rec, index, offsets_, ULINT_UNDEFINED, &heap)))) {
-		if (heap) {
+		if (UNIV_LIKELY_NULL(heap)) {
 			mem_heap_free(heap);
 		}
 		/* Someone else has modified the record later: do not remove */
@@ -135,7 +135,7 @@
 		return(TRUE);
 	}
 
-	if (heap) {
+	if (UNIV_LIKELY_NULL(heap)) {
 		mem_heap_free(heap);
 	}
 

--- 1.18/innobase/row/row0row.c	Thu Mar 10 15:16:00 2005
+++ 1.19/innobase/row/row0row.c	Thu Apr 21 14:23:18 2005
@@ -535,7 +535,7 @@
 	}
 
 	ut_ad(dtuple_check_typed(ref));
-	if (heap) {
+	if (UNIV_LIKELY_NULL(heap)) {
 		mem_heap_free(heap);
 	}
 }

--- 1.87/innobase/row/row0sel.c	Thu Apr 14 10:56:17 2005
+++ 1.88/innobase/row/row0sel.c	Thu Apr 21 14:23:18 2005
@@ -125,7 +125,7 @@
         }
 
 func_exit:
-	if (heap) {
+	if (UNIV_LIKELY_NULL(heap)) {
 		mem_heap_free(heap);
 	}
 	return(is_equal);
@@ -746,7 +746,7 @@
 	*out_rec = clust_rec;
 	err = DB_SUCCESS;
 err_exit:
-	if (heap) {
+	if (UNIV_LIKELY_NULL(heap)) {
 		mem_heap_free(heap);
 	}
 	return(err);
@@ -1066,7 +1066,7 @@
 
 	plan->n_rows_fetched++;
 func_exit:
-	if (heap) {
+	if (UNIV_LIKELY_NULL(heap)) {
 		mem_heap_free(heap);
 	}
 	return(SEL_FOUND);
@@ -1780,7 +1780,7 @@
 	ut_ad(sync_thread_levels_empty_gen(TRUE));
 
 func_exit:
-	if (heap) {
+	if (UNIV_LIKELY_NULL(heap)) {
 		mem_heap_free(heap);
 	}
 	return(err);
@@ -4004,7 +4004,7 @@
 
 func_exit:
 	trx->op_info = "";
-	if (heap) {
+	if (UNIV_LIKELY_NULL(heap)) {
 		mem_heap_free(heap);
 	}
 	return(err);

--- 1.13/innobase/row/row0undo.c	Thu Mar 10 15:16:00 2005
+++ 1.14/innobase/row/row0undo.c	Thu Apr 21 14:23:18 2005
@@ -190,7 +190,7 @@
 
 	btr_pcur_commit_specify_mtr(&(node->pcur), &mtr);
 
-	if (heap) {
+	if (UNIV_LIKELY_NULL(heap)) {
 		mem_heap_free(heap);
 	}
 	return(ret);

--- 1.34/innobase/row/row0upd.c	Thu Mar 10 15:16:00 2005
+++ 1.35/innobase/row/row0upd.c	Thu Apr 21 14:23:18 2005
@@ -1224,7 +1224,7 @@
 	
 	node->n_ext_vec = btr_push_update_extern_fields(node->ext_vec,
 						offsets, update);
-	if (heap) {
+	if (UNIV_LIKELY_NULL(heap)) {
 		mem_heap_free(heap);
 	}
 }
@@ -1423,7 +1423,7 @@
 							index, thr, mtr);
 			if (err != DB_SUCCESS) {
 				mtr_commit(mtr);
-				if (heap) {
+				if (UNIV_LIKELY_NULL(heap)) {
 					mem_heap_free(heap);
 				}
 				return(err);
@@ -1549,7 +1549,7 @@
 			rec_get_offsets(rec, index, offsets_,
 				ULINT_UNDEFINED, &heap),
 			big_rec, mtr);
-		if (heap) {
+		if (UNIV_LIKELY_NULL(heap)) {
 			mem_heap_free(heap);
 		}
 		mtr_commit(mtr);
@@ -1719,7 +1719,7 @@
 			node->index = dict_table_get_next_index(index);
 		}
 	exit_func:
-		if (heap) {
+		if (UNIV_LIKELY_NULL(heap)) {
 			mem_heap_free(heap);
 		}
 		return(err);
@@ -1736,7 +1736,7 @@
 		row_upd_eval_new_vals(node->update);
 	}
 
-	if (heap) {
+	if (UNIV_LIKELY_NULL(heap)) {
 		mem_heap_free(heap);
 	}
 		
@@ -2016,7 +2016,7 @@
 			btr_pcur_get_rec(pcur), btr_cur->index, offsets_,
 			ULINT_UNDEFINED, &heap),
 		UT_LIST_GET_FIRST(node->columns));
-	if (heap) {
+	if (UNIV_LIKELY_NULL(heap)) {
 		mem_heap_free(heap);
 	}
 	row_upd_eval_new_vals(node->update);

--- 1.20/innobase/trx/trx0rec.c	Thu Mar 10 15:16:00 2005
+++ 1.21/innobase/trx/trx0rec.c	Thu Apr 21 14:23:18 2005
@@ -1134,7 +1134,7 @@
 
 			mutex_exit(&(trx->undo_mutex));
 			mtr_commit(&mtr);
-			if (heap) {
+			if (UNIV_LIKELY_NULL(heap)) {
 				mem_heap_free(heap);
 			}
 			return(DB_OUT_OF_FILE_SPACE);
@@ -1153,7 +1153,7 @@
 
 	*roll_ptr = trx_undo_build_roll_ptr(is_insert, rseg->id, page_no,
 								offset);
-	if (heap) {
+	if (UNIV_LIKELY_NULL(heap)) {
 		mem_heap_free(heap);
 	}
 	return(DB_SUCCESS);
Thread
bk commit into 5.0 tree (marko:1.1853)Marko Mäkelä21 Apr