Quoting Eric Engestrom (2017-11-27 09:46:57) > On Saturday, 2017-11-25 18:45:14 +0100, Gert Wollny wrote: > > Am Freitag, den 24.11.2017, 18:07 +0000 schrieb Eric Engestrom: > > > Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com> > > > --- > > > src/util/ralloc.c | 18 +++++++++--------- > > > src/util/slab.c | 4 ++-- > > > 2 files changed, 11 insertions(+), 11 deletions(-) > > > > > > diff --git a/src/util/ralloc.c b/src/util/ralloc.c > > > index 42cfa2e391d52df68db2..b52079ac075a0fe11944 100644 > > > --- a/src/util/ralloc.c > > > +++ b/src/util/ralloc.c > > > @@ -61,7 +61,7 @@ struct > > > #endif > > > ralloc_header > > > { > > > -#ifdef DEBUG > > > +#ifndef NDEBUG > > > /* A canary value used to determine whether a pointer is > > > ralloc'd. */ > > > unsigned canary; > > > #endif > > > @@ -88,7 +88,7 @@ get_header(const void *ptr) > > > { > > > ralloc_header *info = (ralloc_header *) (((char *) ptr) - > > > sizeof(ralloc_header)); > > > -#ifdef DEBUG > > > +#ifndef NDEBUG > > > assert(info->canary == CANARY); > > > #endif > > > > With NDEBUG defined "assert" already translates to a no-op, hence the > > extra "#ifndef NDEBUG" block is not needed (same for the other asserts > > below and in the other patches). > > Indeed, I did so many of those conversions that I wasn't thinking about > that anymore. Thanks for catching that, I'll remove the include guards > altogether around plain asserts()s.
Is that true in this case? info->canary is only defined if NDEBUG is not defined, so this will fail to compile since those symbols are undefined, right? Dylan
signature.asc
Description: signature
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev