Fixed release build using clang on Windows

This commit is contained in:
Sam Lantinga 2022-11-15 12:57:07 -08:00
parent 98f93d0aa1
commit 02ab7f3745

View file

@ -3463,7 +3463,9 @@ add_segment(mstate m, char *tbase, size_t tsize, flag_t mmapped)
msegmentptr ss = (msegmentptr) (chunk2mem(sp)); msegmentptr ss = (msegmentptr) (chunk2mem(sp));
mchunkptr tnext = chunk_plus_offset(sp, ssize); mchunkptr tnext = chunk_plus_offset(sp, ssize);
mchunkptr p = tnext; mchunkptr p = tnext;
#ifdef DEBUG
int nfences = 0; int nfences = 0;
#endif
/* reset top to new space */ /* reset top to new space */
init_top(m, (mchunkptr) tbase, tsize - TOP_FOOT_SIZE); init_top(m, (mchunkptr) tbase, tsize - TOP_FOOT_SIZE);
@ -3481,13 +3483,17 @@ add_segment(mstate m, char *tbase, size_t tsize, flag_t mmapped)
for (;;) { for (;;) {
mchunkptr nextp = chunk_plus_offset(p, SIZE_T_SIZE); mchunkptr nextp = chunk_plus_offset(p, SIZE_T_SIZE);
p->head = FENCEPOST_HEAD; p->head = FENCEPOST_HEAD;
#ifdef DEBUG
++nfences; ++nfences;
#endif
if ((char *) (&(nextp->head)) < old_end) if ((char *) (&(nextp->head)) < old_end)
p = nextp; p = nextp;
else else
break; break;
} }
#ifdef DEBUG
assert(nfences >= 2); assert(nfences >= 2);
#endif
/* Insert the rest of old top into a bin as an ordinary free chunk */ /* Insert the rest of old top into a bin as an ordinary free chunk */
if (csp != old_top) { if (csp != old_top) {