APR::BucketAlloc - Perl API for Bucket Allocation


APR::BucketAlloc - Perl API for Bucket Allocation


  use APR::BucketAlloc ();
  $ba = APR::BucketAlloc->new($pool);


APR::BucketAlloc is used for bucket allocation.


Create an APR::BucketAlloc object:

  $ba = APR::BucketAlloc->new($pool);
class: APR::BucketAlloc
arg1: $pool ( APR::Pool object|docs::2.0::api::APR::Pool )
The pool used to create this object.

ret: $ba ( APR::BucketAlloc object|docs::2.0::api::APR::BucketAlloc )
The new object.

since: 1.99_20

This bucket allocation list (freelist) is used to create new buckets (via APR::Bucket->new|docs::2.0::api::APR::Bucket/C_new_) and bucket brigades (via APR::Brigade->new|docs::2.0::api::APR::Brigade/C_new_).

You only need to use this method if you aren't running under httpd. If you are running under mod_perl, you already have a bucket allocation available via $c->bucket_alloc|docs::2.0::api::Apache2::Connection/C_bucket_alloc_ and $bb->bucket_alloc|docs::2.0::api::APR::Brigade/C_bucket_alloc_.


  use APR::BucketAlloc ();
  use APR::Pool ();
  my $ba = APR::BucketAlloc->(APR::Pool->pool);
  my $eos_b = APR::Bucket::eos_create($ba);


Destroy an APR::BucketAlloc object|docs::2.0::api::APR::BucketAlloc>:

arg1: $ba ( APR::BucketAlloc object|docs::2.0::api::APR::BucketAlloc )
The freelist to destroy.

ret: no return value
since: 1.99_20

Once destroyed this object may not be used again.

You need to destroy $ba only if you have created it via APR::BucketAlloc->new|/C_new_. If you try to destroy an allocation not created by this method, you will get a segmentation fault.

Moreover normally it is not necessary to destroy allocators, since the pool which created them will destroy them during that pool's cleanup phase.

See Also

mod_perl 2.0 documentation.


mod_perl 2.0 and its core modules are copyrighted under The Apache Software License, Version 2.0.


The mod_perl development team and numerous contributors.

 APR::BucketAlloc - Perl API for Bucket Allocation