Merge branch 'kb/maint-bundle-doc' into maint
[gitweb.git] / compat / nedmalloc / nedmalloc.c
index 41a3234e4ea29f972d67870958e8bd8e6f52cbad..91c4e7f27b4063c7ceffeeb1cd43530ce18cf096 100644 (file)
@@ -34,7 +34,7 @@ DEALINGS IN THE SOFTWARE.
 /*#define FULLSANITYCHECKS*/
 
 #include "nedmalloc.h"
-#if defined(WIN32) && !defined(__MINGW32__)
+#if defined(WIN32)
  #include <malloc.h>
 #endif
 #define MSPACES 1
@@ -603,7 +603,10 @@ static NOINLINE mstate FindMSpace(nedpool *p, threadcache *tc, int *lastUsed, si
                }
                /* We really want to make sure this goes into memory now but we
                have to be careful of breaking aliasing rules, so write it twice */
-               *((volatile struct malloc_state **) &p->m[end])=p->m[end]=temp;
+               {
+                       volatile struct malloc_state **_m=(volatile struct malloc_state **) &p->m[end];
+                       *_m=(p->m[end]=temp);
+               }
                ACQUIRE_LOCK(&p->m[end]->mutex);
                /*printf("Created mspace idx %d\n", end);*/
                RELEASE_LOCK(&p->mutex);