Commit 9f7cad32 authored by marko's avatar marko

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

parent fcd34fa2
...@@ -73,12 +73,12 @@ the pointer to the node to be added to the list. NAME is the list name. */ ...@@ -73,12 +73,12 @@ the pointer to the node to be added to the list. NAME is the list name. */
((BASE).count)++;\ ((BASE).count)++;\
((N)->NAME).next = (BASE).start;\ ((N)->NAME).next = (BASE).start;\
((N)->NAME).prev = NULL;\ ((N)->NAME).prev = NULL;\
if ((BASE).start != NULL) {\ if (UNIV_LIKELY((BASE).start != NULL)) {\
ut_ad((BASE).start != (N));\ ut_ad((BASE).start != (N));\
(((BASE).start)->NAME).prev = (N);\ (((BASE).start)->NAME).prev = (N);\
}\ }\
(BASE).start = (N);\ (BASE).start = (N);\
if ((BASE).end == NULL) {\ if (UNIV_UNLIKELY((BASE).end == NULL)) {\
(BASE).end = (N);\ (BASE).end = (N);\
}\ }\
}\ }\
......
...@@ -533,7 +533,7 @@ rec_get_offsets_func( ...@@ -533,7 +533,7 @@ rec_get_offsets_func(
if (UNIV_UNLIKELY(!offsets) if (UNIV_UNLIKELY(!offsets)
|| UNIV_UNLIKELY(rec_offs_get_n_alloc(offsets) < size)) { || UNIV_UNLIKELY(rec_offs_get_n_alloc(offsets) < size)) {
if (!*heap) { if (UNIV_UNLIKELY(!*heap)) {
*heap = mem_heap_create_func(size * sizeof(ulint), *heap = mem_heap_create_func(size * sizeof(ulint),
MEM_HEAP_DYNAMIC, MEM_HEAP_DYNAMIC,
file, line); file, line);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment