Re: [perl #46381] "Out of memory ... sbrk()" on FreeBSD-6.x for v.5.8.x but not v...
Slaven Rezic [Fri, 26 Oct 2007 16:58:55 +0000 (18:58 +0200)]
Message-ID: <874pgd6hxs.fsf@biokovo-amd64.herceg.de>

p4raw-id: //depot/perl@34076

malloc.c

index 914436e..df199c6 100644 (file)
--- a/malloc.c
+++ b/malloc.c
@@ -2293,6 +2293,8 @@ Perl_realloc(void *mp, size_t nbytes)
                nmalloc[bucket]--;
                nmalloc[pow * BUCKETS_PER_POW2]++;
 #endif             
+               if (pow * BUCKETS_PER_POW2 > max_bucket)
+                   max_bucket = pow * BUCKETS_PER_POW2;
                *(cp - M_OVERHEAD) = pow * BUCKETS_PER_POW2; /* Fill index. */
                MALLOC_UNLOCK;
                goto inplace_label;