X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=lib%2Fref.c;h=4e245adf583092ebcb95edb3b1dfc5dfd692b73f;hb=c1870f576149d488615883a7cfd12eddf78bd46a;hp=ac0580137a5ad959d25fbfa29b3a3dc0a7ffae19;hpb=b703b34e4cc4af21278e5eec8f01e5c40687a10b;p=babeltrace.git diff --git a/lib/ref.c b/lib/ref.c index ac058013..4e245adf 100644 --- a/lib/ref.c +++ b/lib/ref.c @@ -31,11 +31,11 @@ void *bt_get(void *ptr) { struct bt_object *obj = ptr; - if (!obj) { + if (unlikely(!obj)) { goto end; } - if (obj->parent && bt_object_get_ref_count(obj) == 0) { + if (unlikely(obj->parent && bt_object_get_ref_count(obj) == 0)) { bt_get(obj->parent); } bt_ref_get(&obj->ref_count); @@ -47,7 +47,7 @@ void bt_put(void *ptr) { struct bt_object *obj = ptr; - if (!obj) { + if (unlikely(!obj)) { return; }