Avoid a -Wundef warning on LG_SLAB_MAXREGS.

This commit is contained in:
David Goldblatt 2020-09-16 15:19:06 -07:00 committed by David Goldblatt
parent 40cf71a06d
commit 7ad2f78663
3 changed files with 11 additions and 9 deletions

View File

@ -1589,10 +1589,10 @@ fi
AC_ARG_WITH([lg_slab_maxregs],
[AS_HELP_STRING([--with-lg-slab-maxregs=<lg-slab-maxregs>],
[Base 2 log of maximum number of regions in a slab (used with malloc_conf slab_sizes)])],
[LG_SLAB_MAXREGS="with_lg_slab_maxregs"],
[LG_SLAB_MAXREGS=""])
[CONFIG_LG_SLAB_MAXREGS="with_lg_slab_maxregs"],
[CONFIG_LG_SLAB_MAXREGS=""])
if test "x$with_lg_slab_maxregs" != "x" ; then
AC_DEFINE_UNQUOTED([LG_SLAB_MAXREGS], [$with_lg_slab_maxregs])
AC_DEFINE_UNQUOTED([CONFIG_LG_SLAB_MAXREGS], [$with_lg_slab_maxregs])
fi
AC_ARG_WITH([lg_page],

View File

@ -183,7 +183,7 @@
#undef LG_PAGE
/* Maximum number of regions in a slab. */
#undef LG_SLAB_MAXREGS
#undef CONFIG_LG_SLAB_MAXREGS
/*
* One huge page is 2^LG_HUGEPAGE bytes. Note that this is defined even if the

View File

@ -270,15 +270,17 @@
#define SC_LARGE_MAXCLASS (SC_MAX_BASE + (SC_NGROUP - 1) * SC_MAX_DELTA)
/* Maximum number of regions in one slab. */
#ifndef LG_SLAB_MAXREGS
#ifndef CONFIG_LG_SLAB_MAXREGS
# define SC_LG_SLAB_MAXREGS (LG_PAGE - SC_LG_TINY_MIN)
#elif (LG_SLAB_MAXREGS < (LG_PAGE - SC_LG_TINY_MIN))
#else
# if CONFIG_LG_SLAB_MAXREGS < (LG_PAGE - SC_LG_TINY_MIN)
# error "Unsupported SC_LG_SLAB_MAXREGS"
# else
# define SC_LG_SLAB_MAXREGS LG_SLAB_MAXREGS
# define SC_LG_SLAB_MAXREGS CONFIG_LG_SLAB_MAXREGS
# endif
#endif
#define SC_SLAB_MAXREGS (1U << SC_LG_SLAB_MAXREGS)
#define SC_SLAB_MAXREGS (1U << SC_LG_SLAB_MAXREGS)
typedef struct sc_s sc_t;
struct sc_s {