From: Slaven Rezic Date: Fri, 26 Oct 2007 16:58:55 +0000 (+0200) Subject: Re: [perl #46381] "Out of memory ... sbrk()" on FreeBSD-6.x for v.5.8.x but not v... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a73918ec93a602356d85f41060eaacc67da45b23;p=p5sagit%2Fp5-mst-13.2.git Re: [perl #46381] "Out of memory ... sbrk()" on FreeBSD-6.x for v.5.8.x but not v.5.6.x Message-ID: <874pgd6hxs.fsf@biokovo-amd64.herceg.de> p4raw-id: //depot/perl@34076 --- diff --git a/malloc.c b/malloc.c index 914436e..df199c6 100644 --- 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;