Author: stas Date: Tue Dec 28 08:36:30 2004 New Revision: 123522 URL: http://svn.apache.org/viewcvs?view=rev&rev=123522 Log: APR::Bucket::alloc_create moved to APR::BucketAlloc::new APR::Bucket::alloc_destroy moved to APR::BucketAlloc::destroy
Added: perl/modperl/trunk/xs/APR/BucketAlloc/ perl/modperl/trunk/xs/APR/BucketAlloc/APR__BucketAlloc.h (contents, props changed) Modified: perl/modperl/trunk/Changes perl/modperl/trunk/t/lib/TestAPRlib/bucket.pm perl/modperl/trunk/xs/APR/Bucket/APR__Bucket.h perl/modperl/trunk/xs/maps/apr_functions.map perl/modperl/trunk/xs/tables/current/ModPerl/FunctionTable.pm Modified: perl/modperl/trunk/Changes Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/Changes?view=diff&rev=123522&p1=perl/modperl/trunk/Changes&r1=123521&p2=perl/modperl/trunk/Changes&r2=123522 ============================================================================== --- perl/modperl/trunk/Changes (original) +++ perl/modperl/trunk/Changes Tue Dec 28 08:36:30 2004 @@ -12,6 +12,9 @@ =item 1.99_20-dev +APR::Bucket::alloc_create moved to APR::BucketAlloc::new +APR::Bucket::alloc_destroy moved to APR::BucketAlloc::destroy [Stas] + prefork handlers optimisation: don't dup the handler struct unless this is a threaded-mpm [Stas] Modified: perl/modperl/trunk/t/lib/TestAPRlib/bucket.pm Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/lib/TestAPRlib/bucket.pm?view=diff&rev=123522&p1=perl/modperl/trunk/t/lib/TestAPRlib/bucket.pm&r1=123521&p2=perl/modperl/trunk/t/lib/TestAPRlib/bucket.pm&r2=123522 ============================================================================== --- perl/modperl/trunk/t/lib/TestAPRlib/bucket.pm (original) +++ perl/modperl/trunk/t/lib/TestAPRlib/bucket.pm Tue Dec 28 08:36:30 2004 @@ -11,6 +11,7 @@ use APR::Pool (); use APR::Bucket (); +use APR::BucketAlloc (); use APR::BucketType (); use APR::Table (); @@ -21,7 +22,7 @@ sub test { my $pool = APR::Pool->new(); - my $ba = APR::Bucket::alloc_create($pool); + my $ba = APR::BucketAlloc->new($pool); # new: basic { @@ -171,7 +172,7 @@ my $data = "foobartar"; my $offset = 3; my $real = substr $data, $offset; - #my $ba = APR::Bucket::alloc_create(APR::Pool->new); + #my $ba = APR::BucketAlloc->new(APR::Pool->new); my $b = APR::Bucket->new($ba, $data, $offset); # try to overwrite the temp pool data @@ -205,8 +206,7 @@ $b->destroy; } - APR::Bucket::alloc_destroy($ba); - + $ba->destroy; } 1; Modified: perl/modperl/trunk/xs/APR/Bucket/APR__Bucket.h Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/xs/APR/Bucket/APR__Bucket.h?view=diff&rev=123522&p1=perl/modperl/trunk/xs/APR/Bucket/APR__Bucket.h&r1=123521&p2=perl/modperl/trunk/xs/APR/Bucket/APR__Bucket.h&r2=123522 ============================================================================== --- perl/modperl/trunk/xs/APR/Bucket/APR__Bucket.h (original) +++ perl/modperl/trunk/xs/APR/Bucket/APR__Bucket.h Tue Dec 28 08:36:30 2004 @@ -117,13 +117,3 @@ return rc; } - -static MP_INLINE -SV *mpxs_APR__Bucket_alloc_create(pTHX_ SV *p_sv) -{ - apr_pool_t *p = mp_xs_sv2_APR__Pool(p_sv); - apr_bucket_alloc_t *ba = apr_bucket_alloc_create(p); - SV *ba_sv = sv_setref_pv(NEWSV(0, 0), "APR::BucketAlloc", (void*)ba); - //mpxs_add_pool_magic(ba_sv, p_sv); - return ba_sv; -} Added: perl/modperl/trunk/xs/APR/BucketAlloc/APR__BucketAlloc.h Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/xs/APR/BucketAlloc/APR__BucketAlloc.h?view=auto&rev=123522 ============================================================================== --- (empty file) +++ perl/modperl/trunk/xs/APR/BucketAlloc/APR__BucketAlloc.h Tue Dec 28 08:36:30 2004 @@ -0,0 +1,29 @@ +/* Copyright 2001-2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "modperl_bucket.h" + +#define mpxs_APR__BucketAlloc_destroy apr_bucket_alloc_destroy + +static MP_INLINE +SV *mpxs_APR__BucketAlloc_new(pTHX_ SV *CLASS, SV *p_sv) +{ + apr_pool_t *p = mp_xs_sv2_APR__Pool(p_sv); + apr_bucket_alloc_t *ba = apr_bucket_alloc_create(p); + SV *ba_sv = sv_setref_pv(NEWSV(0, 0), "APR::BucketAlloc", (void*)ba); + //mpxs_add_pool_magic(ba_sv, p_sv); + return ba_sv; +} + Modified: perl/modperl/trunk/xs/maps/apr_functions.map Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/xs/maps/apr_functions.map?view=diff&rev=123522&p1=perl/modperl/trunk/xs/maps/apr_functions.map&r1=123521&p2=perl/modperl/trunk/xs/maps/apr_functions.map&r2=123522 ============================================================================== --- perl/modperl/trunk/xs/maps/apr_functions.map (original) +++ perl/modperl/trunk/xs/maps/apr_functions.map Tue Dec 28 08:36:30 2004 @@ -123,10 +123,6 @@ mpxs_APR__Bucket_new | | classname, list, sv, offset=0, len=0 void:DEFINE_destroy | | apr_bucket:bucket void:DEFINE_delete | | apr_bucket:bucket ->apr_bucket_alloc -~ apr_bucket_alloc_create - mpxs_APR__Bucket_alloc_create - apr_bucket_alloc_destroy ~apr_bucket_setaside mpxs_APR__Bucket_setaside >apr_bucket_free @@ -162,6 +158,12 @@ !apr_bucket_simple_copy !apr_bucket_destroy_noop !apr_bucket_setaside_noop + +MODULE=APR::BucketAlloc +>apr_bucket_alloc +~apr_bucket_alloc_create + mpxs_APR__BucketAlloc_new + void:DEFINE_destroy | | apr_bucket_alloc_t *:ba MODULE=APR::Pool -apr_pool_num_bytes | | p, recurse=0 #only available with -DAPR_POOL_DEBUG Modified: perl/modperl/trunk/xs/tables/current/ModPerl/FunctionTable.pm Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/xs/tables/current/ModPerl/FunctionTable.pm?view=diff&rev=123522&p1=perl/modperl/trunk/xs/tables/current/ModPerl/FunctionTable.pm&r1=123521&p2=perl/modperl/trunk/xs/tables/current/ModPerl/FunctionTable.pm&r2=123522 ============================================================================== --- perl/modperl/trunk/xs/tables/current/ModPerl/FunctionTable.pm (original) +++ perl/modperl/trunk/xs/tables/current/ModPerl/FunctionTable.pm Tue Dec 28 08:36:30 2004 @@ -2,7 +2,7 @@ # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # ! WARNING: generated by ModPerl::ParseSource/0.01 -# ! Fri Dec 24 18:59:48 2004 +# ! Mon Dec 27 19:15:23 2004 # ! do NOT edit, any changes will be lost ! # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -5517,11 +5517,15 @@ }, { 'return_type' => 'SV *', - 'name' => 'mpxs_APR__Bucket_alloc_create', + 'name' => 'mpxs_APR__BucketAlloc_new', 'args' => [ { 'type' => 'PerlInterpreter *', 'name' => 'my_perl' + }, + { + 'type' => 'SV *', + 'name' => 'CLASS' }, { 'type' => 'SV *',