new(userspace/engine): likely/unlikely macros in utils

Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
This commit is contained in:
Leonardo Di Donato
2021-04-15 10:56:48 +00:00
committed by poiana
parent 65a168ab5a
commit 28a339e4bc

View File

@@ -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
{