On Mar 14, 2007, at 11:01 AM, Nick Kew wrote:
Oh, I guess you mean the copying to get a null-terminated string when applying a regexp? And I see it's repeated for every regexp (ouch)! mod_line_edit uses a local pool which is cleared at the end of each brigade, and avoids multiple copies of the same buffer.
Hmmm... I'm confused. The way I do it is: loop over sed scripts loop over buckets read bucket make copy of bucket data for regex comparison so everytime we read in bucket data, I have to make a null-termed string. It changes with each bucket. So I don't understand the issue with it being "repeated for every regexp". How can that be avoided? I reuse allocated space (I don't just simply keep making strdups)... so yeah, there will be a chunk of allocated spool still hanging around. So maybe making that a subpool and then clearing/destroying it would be best.