branches/zip: Add UNIV_UNLIKELY hints to help branch prediction.

This commit is contained in:
marko 2007-10-26 12:31:48 +00:00
parent a4b26c4ffb
commit 021fea8f15
2 changed files with 3 additions and 3 deletions

View file

@ -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);\
}\
}\

View file

@ -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);