summaryrefslogtreecommitdiff
path: root/src/common/compat.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-05-24 17:12:57 +0000
committerNick Mathewson <nickm@torproject.org>2007-05-24 17:12:57 +0000
commitd3d86b17a761011f62dc2e06c04c0af8f1a75ef6 (patch)
treeefb329c2d77ef6f39c02db8db62bfa18ad5f4d6d /src/common/compat.h
parentd0a5c4f9848f44c46f001428bd3078673033ef19 (diff)
downloadtor-d3d86b17a761011f62dc2e06c04c0af8f1a75ef6.tar.gz
tor-d3d86b17a761011f62dc2e06c04c0af8f1a75ef6.zip
r12916@catbus: nickm | 2007-05-24 12:43:45 -0400
Add math functions to round values to the nearest power of 2. Make mempools more careful about making sure that the size of their chunks is a little less than a power of 2, not a little more. svn:r10304
Diffstat (limited to 'src/common/compat.h')
-rw-r--r--src/common/compat.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/common/compat.h b/src/common/compat.h
index 085af036d1..cd36437407 100644
--- a/src/common/compat.h
+++ b/src/common/compat.h
@@ -96,6 +96,7 @@ extern INLINE double U64_TO_DBL(uint64_t x) {
#if defined(__GNUC__) && __GNUC__ >= 3
#define ATTR_NORETURN __attribute__((noreturn))
#define ATTR_PURE __attribute__((pure))
+#define ATTR_CONST __attribute__((const))
#define ATTR_MALLOC __attribute__((malloc))
#define ATTR_NORETURN __attribute__((noreturn))
#define ATTR_NONNULL(x) __attribute__((nonnull x))
@@ -108,6 +109,7 @@ extern INLINE double U64_TO_DBL(uint64_t x) {
#else
#define ATTR_NORETURN
#define ATTR_PURE
+#define ATTR_CONST
#define ATTR_MALLOC
#define ATTR_NORETURN
#define ATTR_NONNULL(x)