On 8/26/2011 7:03 AM, "Plüm, Rüdiger, VF-Group" wrote: > >> From: Jim Jagielski [mailto:[email protected]] >> 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 :)
