]> arthur.barton.de Git - netdata.git/blobdiff - src/common.h
code optimizations; added temperature charts.d plugin
[netdata.git] / src / common.h
index 90ae14979adae9d24a0797f22432eda529bdc5c0..85c3071286d3c28932070c9bd11b94d599098277 100755 (executable)
@@ -16,4 +16,14 @@ extern int savememory(const char *filename, void *mem, unsigned long size);
 
 extern int fd_is_valid(int fd);
 
+#ifdef __GNUC__
+// gcc branch optimization
+// #warning "Using GCC branch optimizations"
+#define likely(x)       __builtin_expect(!!(x), 1)
+#define unlikely(x)     __builtin_expect(!!(x), 0)
+#else
+#define likely(x)       (x)
+#define unlikely(x)     (x)
+#endif
+
 #endif /* NETDATA_COMMON_H */