aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2024-02-26 20:03:31 -0800
committerChristopher Ferris <cferris@google.com>2024-04-09 14:03:42 -0700
commitae97b9296bfcd8513eef5877e02f486458027df7 (patch)
treee60581edc93ab6a53ac9f6e90461110a92fa7bbb
parent255a0cbc4a18f900d39b15fdbb7d291fbc5f6a78 (diff)
downloaddlmalloc-ae97b9296bfcd8513eef5877e02f486458027df7.tar.gz
Fix unused variable warning.HEADmastermain
Since nfences is only used in an assert, mark it as maybe unused. Test: Builds without warnings. Change-Id: I25cc42699781740e5335a67a8f48e2c883dba264
-rw-r--r--dlmalloc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/dlmalloc.c b/dlmalloc.c
index a61c0da..3eb761d 100644
--- a/dlmalloc.c
+++ b/dlmalloc.c
@@ -4009,7 +4009,8 @@ static void add_segment(mstate m, char* tbase, size_t tsize, flag_t mmapped) {
msegmentptr ss = (msegmentptr)(chunk2mem(sp));
mchunkptr tnext = chunk_plus_offset(sp, ssize);
mchunkptr p = tnext;
- int nfences = 0;
+ /* Only used in assert. */
+ [[maybe_unused]] int nfences = 0;
/* reset top to new space */
init_top(m, (mchunkptr)tbase, tsize - TOP_FOOT_SIZE);