mirror of
https://github.com/falcosecurity/falco.git
synced 2025-08-31 22:28:22 +00:00
new(userspace/engine): likely/unlikely macros in utils
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
This commit is contained in:
committed by
poiana
parent
65a168ab5a
commit
28a339e4bc
@@ -17,6 +17,8 @@ limitations under the License.
|
||||
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <sstream>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
@@ -24,7 +26,13 @@ limitations under the License.
|
||||
#include <thread>
|
||||
#include <nonstd/string_view.hpp>
|
||||
|
||||
#pragma once
|
||||
#ifdef __GNUC__
|
||||
#define likely(x) __builtin_expect(!!(x), 1)
|
||||
#define unlikely(x) __builtin_expect(!!(x), 0)
|
||||
#else
|
||||
#define likely(x) (x)
|
||||
#define unlikely(x) (x)
|
||||
#endif
|
||||
|
||||
namespace falco
|
||||
{
|
||||
|
Reference in New Issue
Block a user