From rbb@covalent.net Tue Feb 6 16:25:06 2001 Return-Path: Mailing-List: contact cvs-help@apr.apache.org; run by ezmlm Delivered-To: mailing list cvs@apr.apache.org Received: (qmail 90764 invoked by uid 500); 6 Feb 2001 16:25:06 -0000 Delivered-To: apmail-apr-util-cvs@apache.org Received: (qmail 90761 invoked from network); 6 Feb 2001 16:25:06 -0000 Received: from sfo-gw.covalent.net (HELO koj.covalent.net) (207.44.198.62) by h31.sny.collab.net with SMTP; 6 Feb 2001 16:25:06 -0000 Received: from rbb (helo=localhost) by koj.covalent.net with local-esmtp (Exim 3.16 #1) id 14QAz7-0000nm-00; Tue, 06 Feb 2001 08:28:53 -0800 Date: Tue, 6 Feb 2001 08:28:53 -0800 (PST) From: rbb@covalent.net X-Sender: rbb@koj To: dev@apr.apache.org cc: apr-util-cvs@apache.org Subject: Re: cvs commit: apr-util/buckets apr_buckets_heap.c In-Reply-To: <20010206162119.86486.qmail@apache.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N > Modified: modules/generators mod_cgi.c mod_cgid.c > buckets apr_buckets_heap.c Damn, I committed from too high in my tree. :-( The bucket change was supposed to happen in the next commit. Basically, we try to overallocate in the heap bucket itself, which is incorrect. This patch fixes that behavior, so that we don't try to outsmart the bucket in the make_heap function. If we want to buffer data in a bucket, then we have to do it right, which means having functions that can take care of the extra space. This is what the patch I posted last night does, so the current hack goes away, because it is just allocating extra space that we never use. > Index: apr_buckets_heap.c > =================================================================== > RCS file: /home/cvs/apr-util/buckets/apr_buckets_heap.c,v > retrieving revision 1.23 > retrieving revision 1.24 > diff -u -d -b -w -u -r1.23 -r1.24 > --- apr_buckets_heap.c 2001/01/19 07:02:00 1.23 > +++ apr_buckets_heap.c 2001/02/06 16:21:17 1.24 > @@ -58,20 +58,6 @@ > #include > #endif > > -/* > - * The size of heap bucket memory allocations. > - * XXX: This is currently a guess and should be adjusted to an > - * empirically good value. > - */ > -#ifndef DEFAULT_BUCKET_SIZE > -#define DEFAULT_BUCKET_SIZE (4096) > -#endif > - > -#ifndef max > -#define max(x,y) \ > -((x) >= (y) ? (x) : (y)) > -#endif > - > static apr_status_t heap_read(apr_bucket *b, const char **str, > apr_size_t *len, apr_read_type_e block) > { > @@ -106,7 +92,7 @@ > } > > if (copy) { > - h->alloc_len = max(DEFAULT_BUCKET_SIZE, length); > + h->alloc_len = length; > h->base = malloc(h->alloc_len); > if (h->base == NULL) { > free(h); > > > > > _______________________________________________________________________________ Ryan Bloom rbb@apache.org 406 29th St. San Francisco, CA 94131 -------------------------------------------------------------------------------