浏览代码

Fixed release build using clang on Windows

Sam Lantinga 2 年之前
父节点
当前提交
02ab7f3745
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      src/stdlib/SDL_malloc.c

+ 6 - 0
src/stdlib/SDL_malloc.c

@@ -3463,7 +3463,9 @@ 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;
+#ifdef DEBUG
     int nfences = 0;
+#endif
 
     /* reset top to new space */
     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 (;;) {
         mchunkptr nextp = chunk_plus_offset(p, SIZE_T_SIZE);
         p->head = FENCEPOST_HEAD;
+#ifdef DEBUG
         ++nfences;
+#endif
         if ((char *) (&(nextp->head)) < old_end)
             p = nextp;
         else
             break;
     }
+#ifdef DEBUG
     assert(nfences >= 2);
+#endif
 
     /* Insert the rest of old top into a bin as an ordinary free chunk */
     if (csp != old_top) {