summaryrefslogtreecommitdiffstats
path: root/src/libnetdata/bitmap/bitmap64.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-11-25 14:45:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-11-25 14:48:03 +0000
commite55403ed71282d7bfd8b56df219de3c28a8af064 (patch)
tree524889e5becb81643bf8741e3082955dca076f09 /src/libnetdata/bitmap/bitmap64.h
parentReleasing debian version 1.47.5-1. (diff)
downloadnetdata-e55403ed71282d7bfd8b56df219de3c28a8af064.tar.xz
netdata-e55403ed71282d7bfd8b56df219de3c28a8af064.zip
Merging upstream version 2.0.3+dfsg:
- does not include dygraphs anymore (Closes: #923993) - does not include pako anymore (Closes: #1042533) - does not include dashboard binaries anymore (Closes: #1045145) Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/libnetdata/bitmap/bitmap64.h')
-rw-r--r--src/libnetdata/bitmap/bitmap64.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/libnetdata/bitmap/bitmap64.h b/src/libnetdata/bitmap/bitmap64.h
new file mode 100644
index 000000000..425f3fd20
--- /dev/null
+++ b/src/libnetdata/bitmap/bitmap64.h
@@ -0,0 +1,35 @@
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#ifndef NETDATA_BITMAP64_H
+#define NETDATA_BITMAP64_H
+
+#include <stdbool.h>
+#include <stdint.h>
+#include <assert.h>
+
+typedef uint64_t bitmap64_t;
+
+#define BITMAP64_INITIALIZER 0
+
+static inline void bitmap64_set(bitmap64_t *bitmap, int position)
+{
+ assert(position >= 0 && position < 64);
+
+ *bitmap |= (1ULL << position);
+}
+
+static inline void bitmap64_clear(bitmap64_t *bitmap, int position)
+{
+ assert(position >= 0 && position < 64);
+
+ *bitmap &= ~(1ULL << position);
+}
+
+static inline bool bitmap64_get(const bitmap64_t *bitmap, int position)
+{
+ assert(position >= 0 && position < 64);
+
+ return (*bitmap & (1ULL << position));
+}
+
+#endif // NETDATA_BITMAP64_H