From efe3e1778b0af942a7578c3ae1cc901fc66d4d6d Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Sat, 25 Nov 2017 22:40:23 +0100 Subject: [PATCH] Add some likely to some conditions --- m-i-shared.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/m-i-shared.h b/m-i-shared.h index 62a12eb2..f0d64798 100644 --- a/m-i-shared.h +++ b/m-i-shared.h @@ -78,7 +78,7 @@ static inline type * \ M_C(name, _init)(type *ptr) \ { \ - if (ptr != NULL) \ + if (M_LIKELY (ptr != NULL)) \ atomic_init(&ptr->M_C(name, _cpt), 1); \ return ptr; \ } \ @@ -86,7 +86,7 @@ static inline type * \ M_C(name, _init_set)(type *shared) \ { \ - if (shared != NULL) { \ + if (M_LIKELY (shared != NULL)) { \ int n = atomic_fetch_add(&(shared->M_C(name, _cpt)), 1); \ (void) n; \ } \