mirror of
https://github.com/falcosecurity/falco.git
synced 2025-09-03 15:46:33 +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 <sstream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@@ -24,7 +26,13 @@ limitations under the License.
|
|||||||
#include <thread>
|
#include <thread>
|
||||||
#include <nonstd/string_view.hpp>
|
#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
|
namespace falco
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user