Stas Bekman <[EMAIL PROTECTED]> writes:
[...]
that's already scheduled for 2.0 release: todo/release:
* consider changing the allocation method in APR::Bucket::new from malloc/free to bucket_alloc, like all other buckets do
If you can work on that, it'd be a great help, Joe.
I'm happy to scratch that itch, since it's been itching me for a while now.
joe++
The real question, I think, is whether or not we should add an apr_bucket_alloc_t * argument to modperl_bucket_sv_create(), (so then APR::Bucket::new would expect another bucket allocator argument), or stick to malloc/free.
Well, if we didn't try to avoid the string copying, we could have just dropped modperl buckets altogether and just use plain string buckets. But it's not a good idea.
So hard is it going to be to stick with malloc/free vs. using the bucket_alloc. Or is there are a good reason against using malloc/free?
I don't see the relationship. I think it's a good idea to
drop malloc/free because apr_bucket_alloc will outperform it,
and we can safely reuse more of the existing apr_bucket_* code in
modperl_bucket.c We don't have to throw out svbuckets altogether, we'd just need to change the Perl calling pattern from
my $bucket = APR::Bucket->new($data);
to
my $bucket = APR::Bucket->new($data, $bb->bucket_alloc);
+1, how about
my $bucket = APR::Bucket->new($bb->bucket_alloc, $data);
so the bucket alloc is always there, and the other things might become optional later on (e.g. if you want to just create a bucket but not put anything in it until later on). So you could do:
my $bucket = APR::Bucket->new($bb->bucket_alloc); $bucket->concat($data) or something like that
-- __________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
