$\1 and serious bug in evalling
[p5sagit/p5-mst-13.2.git] / malloc.c
index df66e90..3aeb088 100644 (file)
--- a/malloc.c
+++ b/malloc.c
@@ -496,7 +496,7 @@ free(mp)
        bucket = OV_INDEX(op);
 #endif 
        if (OV_MAGIC(op, bucket) != MAGIC) {
-               static bad_free_warn = -1;
+               static int bad_free_warn = -1;
                if (bad_free_warn == -1) {
                    char *pbf = getenv("PERL_BADFREE");
                    bad_free_warn = (pbf) ? atoi(pbf) : 1;
@@ -781,6 +781,9 @@ int size;
 #ifdef PERL_CORE
     reqsize = size; /* just for the DEBUG_m statement */
 #endif
+#ifdef PACK_MALLOC
+    size = (size + 0x7ff) & ~0x7ff;
+#endif
     if (size <= Perl_sbrk_oldsize) {
        got = Perl_sbrk_oldchunk;
        Perl_sbrk_oldchunk += size;
@@ -796,6 +799,9 @@ int size;
        small = 1;
       }
       got = (IV)SYSTEM_ALLOC(size);
+#ifdef PACK_MALLOC
+      got = (got + 0x7ff) & ~0x7ff;
+#endif
       if (small) {
        /* Chunk is small, register the rest for future allocs. */
        Perl_sbrk_oldchunk = got + reqsize;