Skip to content

Commit

Permalink
new(modern): add likely unlikely definitions
Browse files Browse the repository at this point in the history
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
  • Loading branch information
Andreagit97 committed May 9, 2024
1 parent cdbd5ab commit 2a9f3c7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions driver/modern_bpf/definitions/missing_definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@

/* This header should include different definitions according to different architectures.*/

#ifndef likely
# define likely(X) __builtin_expect(!!(X), 1)
#endif

#ifndef unlikely
# define unlikely(X) __builtin_expect(!!(X), 0)
#endif

/*
* Per process flags
*/
Expand Down

0 comments on commit 2a9f3c7

Please sign in to comment.