On Sat, Jun 19, 2004 at 11:17:28PM +0300, Stas Bekman wrote: > Joe Orton wrote: > >Hiya folks, just wondering what impact (if any) these changes I've been > >working on would have on mod_perl and filters implemented using > >mod_perl? > > > >The change is simply that after calling ap_pass_brigade() on a brigade, > >any subsequent use of that brigade is likely to segfault since the > >brigade structure really is free'd. > > I understood that only the content/buckets are lost, but the bb itself > remains re-usable. We have quite a few tests that go like this (.e.g see: > t/filter/TestFilter/both_str_con_add.pm): ...
OK, thanks, useful info. I guess you prefer the model where a filter may never destroy the brigade which it is passed, and it's the responsibility of whomever *creates* the brigade to destroy it. > Why should we create bb in a tight loop when we can make things faster and > re-use the shell? Sounds like a waste of CPU cycles and memory to me. With the patches I have it's not really expensive. But currently we're in a mess where it's not clear who should destroy the brigade, and so they are often getting destroyed and then reused, or sometimes never destroyed at all. And destroy doesn't really free the brigade anyway so the memory is leaked everywhere. I'm going to go through and see if all the memory leaks can be fixed using the "creator must destroy" model and see if that will work instead since it will probably be less disruptive to third-party filters. Regards, joe --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]