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

Kenneth Graunke kenneth at whitecape.org
Mon Jul 2 18:00:41 UTC 2018


On Monday, July 2, 2018 7:59:31 AM PDT Jason Ekstrand wrote:
> v2 (Jason Ekstrand):
>  - Rename y to pot_align (Brian)
>  - Also use ALIGN_POT in build_id.c and slab.c (Brian)
> 
> Cc: Brian Paul <brianp at vmware.com>
> Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>
> ---
>  src/util/build_id.c | 7 +++----
>  src/util/macros.h   | 3 +++
>  src/util/ralloc.c   | 2 --
>  src/util/slab.c     | 6 ++----
>  4 files changed, 8 insertions(+), 10 deletions(-)

I like moving these to src/util/macros.h.  I think the ALIGN_POT name
is a bit strange though, we normally just call that ALIGN.

For example, src/mesa/main/macros.h defines functions (not macros!)
called ALIGN (requires power-of-two) and ALIGN_NPOT.  Gallium's
src/gallium/auxiliary/util/u_math.h defines align(), align64(), and
util_align_npot() functions as well.

That said, if you rename it, you'll probably conflict with main/macros.h
and have to clean that up too, and then you get into functions vs macros
and...I'm not sure I want to make you do that today. :(
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180702/ca77270f/attachment.sig>


More information about the mesa-dev mailing list