mod_perl logo perl icon
previous page: APR::Bucket - Perl API for manipulating APR Bucketspage up: mod_perl 2.0 APInext page: APR::BucketType - Perl API for APR bucket types

APR::BucketAlloc - Perl API for Bucket Allocation






Embedding Perl in HTML with Mason

Embedding Perl in HTML with Mason

By Dave Rolsky, Ken Williams
mod_perl2 User's Guide

mod_perl2 User's Guide

By Stas Bekman, Jim Brandt
Practical mod_perl

Practical mod_perl

By Stas Bekman, Eric Cholet
The mod_perl Developer's Cookbook

The mod_perl Developer's Cookbook

By Geoffrey Young, Paul Lindner, Randy Kobes
mod_perl Pocket Reference

mod_perl Pocket Reference

By Andrew Ford
Writing Apache Modules with Perl and C

Writing Apache Modules with Perl and C

By Lincoln Stein, Doug MacEachern


Table of Contents

Synopsis

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


TOP

Description

APR::BucketAlloc is used for bucket allocation.



TOP

new

Create an APR::BucketAlloc object:

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

This bucket allocation list (freelist) is used to create new buckets (via APR::Bucket->new) and bucket brigades (via APR::Brigade->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 and $bb->bucket_alloc.

Example:

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


TOP

destroy

Destroy an APR::BucketAlloc object:

  $ba->destroy;

Once destroyed this object may not be used again.

You need to destroy $ba only if you have created it via APR::BucketAlloc->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.



TOP

See Also

mod_perl 2.0 documentation.



TOP

Copyright

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



TOP

Authors

The mod_perl development team and numerous contributors.






TOP
previous page: APR::Bucket - Perl API for manipulating APR Bucketspage up: mod_perl 2.0 APInext page: APR::BucketType - Perl API for APR bucket types