<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Jul 2, 2018 at 6:33 AM, Brian Paul <span dir="ltr"><<a href="mailto:brianp@vmware.com" target="_blank">brianp@vmware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 06/29/2018 06:13 PM, Jason Ekstrand wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
---<br>
  src/util/macros.h | 3 +++<br>
  src/util/ralloc.c | 2 --<br>
  2 files changed, 3 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/util/macros.h b/src/util/macros.h<br>
index 6d3df904082..95b86c7a31a 100644<br>
--- a/src/util/macros.h<br>
+++ b/src/util/macros.h<br>
@@ -285,6 +285,9 @@ do {                       \<br>
  #define MIN3( A, B, C ) ((A) < (B) ? MIN2(A, C) : MIN2(B, C))<br>
  #define MAX3( A, B, C ) ((A) > (B) ? MAX2(A, C) : MAX2(B, C))<br>
  +/** Align a value to a power of two */<br>
+#define ALIGN_POT(x, y) (((x) + (y) - 1) & ~((y) - 1))<br>
</blockquote>
<br></span>
Maybe improve the comment to say that y must be a power of two value?<br>
<br>
Maybe rename 'y' to 'pot'?<br></blockquote><div><br></div><div>Do you want one or both?  I've sent a v2 which just renames "y" to "align_pot" and leaves the comment alone.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The same macro is in src/util/slab.c and build_id.c too (at least).<span class="HOEnZb"><font color="#888888"><br></font></span></blockquote><div><br></div><div>Good catch.  Fixed in v2.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="HOEnZb"><font color="#888888">
-Brian</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+<br>
  /**<br>
   * Macro for declaring an explicit conversion operator.  Defaults to an<br>
   * implicit conversion if C++11 is not supported.<br>
diff --git a/src/util/ralloc.c b/src/util/ralloc.c<br>
index 42cfa2e391d..5d77f75ee85 100644<br>
--- a/src/util/ralloc.c<br>
+++ b/src/util/ralloc.c<br>
@@ -553,8 +553,6 @@ ralloc_vasprintf_rewrite_tail(<wbr>char **str, size_t *start, const char *fmt,<br>
   * other buffers.<br>
   */<br>
  -#define ALIGN_POT(x, y) (((x) + (y) - 1) & ~((y) - 1))<br>
-<br>
  #define MIN_LINEAR_BUFSIZE 2048<br>
  #define SUBALLOC_ALIGNMENT sizeof(uintptr_t)<br>
  #define LMAGIC 0x87b9c7d3<br>
<br>
</blockquote>
<br>
</div></div></blockquote></div><br></div></div>