More ruthless editing from Hugo van der Sanden.
[p5sagit/p5-mst-13.2.git] / malloc.c
index 1a048f7..57ca5a1 100644 (file)
--- a/malloc.c
+++ b/malloc.c
      warn(format, arg)                 fprintf(stderr, idem)
 
      # Locking/unlocking for MT operation
-     MALLOC_LOCK                       MUTEX_LOCK_NOCONTEXT(&PL_malloc_mutex)
-     MALLOC_UNLOCK                     MUTEX_UNLOCK_NOCONTEXT(&PL_malloc_mutex)
+     MALLOC_LOCK                       MUTEX_LOCK(&PL_malloc_mutex)
+     MALLOC_UNLOCK                     MUTEX_UNLOCK(&PL_malloc_mutex)
 
      # Locking/unlocking mutex for MT operation
      MUTEX_LOCK(l)                     void
 #endif 
 
 #ifndef MALLOC_LOCK
-#  define MALLOC_LOCK          MUTEX_LOCK_NOCONTEXT(&PL_malloc_mutex)
+#  define MALLOC_LOCK          MUTEX_LOCK(&PL_malloc_mutex)
 #endif 
 
 #ifndef MALLOC_UNLOCK
-#  define MALLOC_UNLOCK                MUTEX_UNLOCK_NOCONTEXT(&PL_malloc_mutex)
+#  define MALLOC_UNLOCK                MUTEX_UNLOCK(&PL_malloc_mutex)
 #endif 
 
 #  ifndef fatalcroak                           /* make depend */
@@ -441,8 +441,8 @@ union       overhead {
        double  strut;                  /* alignment problems */
 #endif
        struct {
-               u_char  ovu_magic;      /* magic number */
                u_char  ovu_index;      /* bucket # */
+               u_char  ovu_magic;      /* magic number */
 #ifdef RCHECK
                u_short ovu_size;       /* actual block size */
                u_int   ovu_rmagic;     /* range magic number */
@@ -1752,8 +1752,7 @@ Perl_realloc(void *mp, size_t nbytes)
                nmalloc[bucket]--;
                nmalloc[pow * BUCKETS_PER_POW2]++;
 #endif             
-               ((union overhead *)(cp - M_OVERHEAD))->ov_index
-                 = pow * BUCKETS_PER_POW2; /* Fill index. */
+               *(cp - M_OVERHEAD) = pow * BUCKETS_PER_POW2; /* Fill index. */
                MALLOC_UNLOCK;
                goto inplace_label;
            } else {