Return-Path: X-Original-To: apmail-httpd-dev-archive@www.apache.org Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 948708E78 for ; Fri, 26 Aug 2011 16:26:05 +0000 (UTC) Received: (qmail 58320 invoked by uid 500); 26 Aug 2011 16:26:04 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 58047 invoked by uid 500); 26 Aug 2011 16:26:03 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 58039 invoked by uid 99); 26 Aug 2011 16:26:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Aug 2011 16:26:03 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [72.167.82.89] (HELO p3plsmtpa01-09.prod.phx3.secureserver.net) (72.167.82.89) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 26 Aug 2011 16:25:54 +0000 Received: (qmail 32500 invoked from network); 26 Aug 2011 16:25:31 -0000 Received: from unknown (76.252.112.72) by p3plsmtpa01-09.prod.phx3.secureserver.net (72.167.82.89) with ESMTP; 26 Aug 2011 16:25:31 -0000 Message-ID: <4E57C8F6.5070906@rowe-clan.net> Date: Fri, 26 Aug 2011 11:25:26 -0500 From: "William A. Rowe Jr." User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: dev@httpd.apache.org Subject: Re: svn commit: r1161661 - /httpd/httpd/trunk/modules/http/byterange_filter.c References: <20110825173819.8448423889B3@eris.apache.org> <4E57421E.8040409@apache.org> <0A859B5A-D3ED-42B8-AE04-93622A6B0115@jaguNET.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org On 8/26/2011 7:03 AM, "Plüm, Rüdiger, VF-Group" wrote: > >> From: Jim Jagielski [mailto:jim@jaguNET.com] >> Sent: Freitag, 26. August 2011 13:49 >> >> My plan is to put each range into an array and at the >> end flatten it via apr_array_pstrcat() > > I thought about that as well, but I think a combination of a preallocated > buffer and apr_snprintf using a moving pointer in this buffer could > save even more memory in the typical use case. > Of course this changes if you remove a lot of ranges by merging. But the "wasted" memory is insignificant compared to the CPU saved by not resizing the buffers, IMHO Yet another example where we need apr_prealloc :)