mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
sprinkly SPA_LIKELY/UNLIKELY around
This commit is contained in:
parent
d762d57665
commit
cb7bfdf98a
10 changed files with 118 additions and 129 deletions
|
|
@ -133,14 +133,14 @@ spa_hook_list_join(struct spa_hook_list *list,
|
|||
#define spa_callbacks_call(callbacks,type,method,vers,...) \
|
||||
({ \
|
||||
const type *_f = (const type *) (callbacks)->funcs; \
|
||||
if (_f && _f->version >= (vers) && _f->method) \
|
||||
if (SPA_LIKELY(_f && _f->version >= (vers) && _f->method)) \
|
||||
_f->method((callbacks)->data, ## __VA_ARGS__); \
|
||||
})
|
||||
|
||||
#define spa_callbacks_call_res(callbacks,type,res,method,vers,...) \
|
||||
({ \
|
||||
const type *_f = (const type *) (callbacks)->funcs; \
|
||||
if (_f && _f->version >= (vers) && _f->method) \
|
||||
if (SPA_LIKELY(_f && _f->version >= (vers) && _f->method)) \
|
||||
res = _f->method((callbacks)->data, ## __VA_ARGS__); \
|
||||
res; \
|
||||
})
|
||||
|
|
@ -171,7 +171,7 @@ spa_hook_list_join(struct spa_hook_list *list,
|
|||
spa_list_cursor_start(cursor, s, link); \
|
||||
spa_list_for_each_cursor(ci, cursor, &list->list, link) { \
|
||||
const type *_f = (const type *)ci->cb.funcs; \
|
||||
if (_f && _f->version >= (vers) && _f->method) { \
|
||||
if (SPA_LIKELY(_f && _f->version >= (vers) && _f->method)) { \
|
||||
_f->method(ci->cb.data, ## __VA_ARGS__); \
|
||||
count++; \
|
||||
if (once) \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue