[Mesa-dev] [PATCH v2 1/9] util/macros: Import ALIGN_POT from ralloc.c

Jason Ekstrand jason at jlekstrand.net
Sat Jun 30 00:13:49 UTC 2018


---
 src/util/macros.h | 3 +++
 src/util/ralloc.c | 2 --
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/util/macros.h b/src/util/macros.h
index 6d3df904082..95b86c7a31a 100644
--- a/src/util/macros.h
+++ b/src/util/macros.h
@@ -285,6 +285,9 @@ do {                       \
 #define MIN3( A, B, C ) ((A) < (B) ? MIN2(A, C) : MIN2(B, C))
 #define MAX3( A, B, C ) ((A) > (B) ? MAX2(A, C) : MAX2(B, C))
 
+/** Align a value to a power of two */
+#define ALIGN_POT(x, y) (((x) + (y) - 1) & ~((y) - 1))
+
 /**
  * Macro for declaring an explicit conversion operator.  Defaults to an
  * implicit conversion if C++11 is not supported.
diff --git a/src/util/ralloc.c b/src/util/ralloc.c
index 42cfa2e391d..5d77f75ee85 100644
--- a/src/util/ralloc.c
+++ b/src/util/ralloc.c
@@ -553,8 +553,6 @@ ralloc_vasprintf_rewrite_tail(char **str, size_t *start, const char *fmt,
  * other buffers.
  */
 
-#define ALIGN_POT(x, y) (((x) + (y) - 1) & ~((y) - 1))
-
 #define MIN_LINEAR_BUFSIZE 2048
 #define SUBALLOC_ALIGNMENT sizeof(uintptr_t)
 #define LMAGIC 0x87b9c7d3
-- 
2.17.1



More information about the mesa-dev mailing list