microperl config update.
[p5sagit/p5-mst-13.2.git] / malloc.c
index e031b45..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 */
@@ -828,6 +828,16 @@ static char bucket_of[] =
 #  define SBRK_FAILURE_PRICE 50
 #endif 
 
+static void    morecore        (register int bucket);
+#  if defined(DEBUGGING)
+static void    botch           (char *diag, char *s);
+#  endif
+static void    add_to_chain    (void *p, MEM_SIZE size, MEM_SIZE chip);
+static void*   get_from_chain  (MEM_SIZE size);
+static void*   get_from_bigger_buckets(int bucket, MEM_SIZE size);
+static union overhead *getpages        (MEM_SIZE needed, int *nblksp, int bucket);
+static int     getpages_adjacent(MEM_SIZE require);
+
 #if defined(PERL_EMERGENCY_SBRK) && defined(PERL_CORE)
 
 #  ifndef BIG_SIZE
@@ -844,17 +854,6 @@ static char bucket_of[] =
 static char *emergency_buffer;
 static MEM_SIZE emergency_buffer_size;
 
-static void    morecore        (register int bucket);
-#  if defined(DEBUGGING)
-static void    botch           (char *diag, char *s);
-#  endif
-static void    add_to_chain    (void *p, MEM_SIZE size, MEM_SIZE chip);
-static Malloc_t        emergency_sbrk  (MEM_SIZE size);
-static void*   get_from_chain  (MEM_SIZE size);
-static void*   get_from_bigger_buckets(int bucket, MEM_SIZE size);
-static union overhead *getpages        (MEM_SIZE needed, int *nblksp, int bucket);
-static int     getpages_adjacent(MEM_SIZE require);
-
 static Malloc_t
 emergency_sbrk(MEM_SIZE size)
 {
@@ -1979,17 +1978,6 @@ Perl_dump_mstats(pTHX_ char *s)
 
 #   if defined(__MACHTEN_PPC__) || defined(NeXT) || defined(__NeXT__) || defined(PURIFY)
 #      define PERL_SBRK_VIA_MALLOC
-/*
- * MachTen's malloc() returns a buffer aligned on a two-byte boundary.
- * While this is adequate, it may slow down access to longer data
- * types by forcing multiple memory accesses.  It also causes
- * complaints when RCHECK is in force.  So we allocate six bytes
- * more than we need to, and return an address rounded up to an
- * eight-byte boundary.
- *
- * 980701 Dominic Dunlop <domo@computer.org>
- */
-#      define SYSTEM_ALLOC_ALIGNMENT 2
 #   endif
 
 #   ifdef PERL_SBRK_VIA_MALLOC