docs::a...ketAlloc(3)

πŸ“¦ version 2.0.13, in nixos 26.05, nixpkgs unstable

🌸 NAME 🌸

Okay bestie, welcome to docs::a...ketAlloc(3) β€” a page straight outta the User Contributed Perl Documentation section, and it's giving β€œPerl API for Bucket Allocation” realness. πŸ’…

APR::BucketAlloc β€” Perl API for Bucket Allocation.


✨ Synopsis ✨

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

πŸ’– Description πŸ’–

So like, APR::BucketAlloc is used for bucket allocation. That's the whole vibe. πŸͺ£βœ¨

🌟 new 🌟

Create an APR::BucketAlloc object:

$ba = APR::BucketAlloc->new($pool);
  • class: APR::BucketAlloc
  • arg1: $pool (APR::Pool object) β€” the pool used to create this object.
  • ret: $ba (APR::BucketAlloc object) β€” the new object.
  • since: 2.0.00

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. No cap. 🧒

Example:

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

πŸ’€ destroy πŸ’€

Destroy an APR::BucketAlloc object:

$ba->destroy;
  • arg1: $ba (APR::BucketAlloc object) β€” the freelist to destroy.
  • ret: no return value
  • since: 2.0.00

Once destroyed, this object may not be used again. Like, it's done. Periodt. 🚫✨

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. πŸ˜­πŸ’€ So maybe don't do that, bestie.

Moreover, normally it is not necessary to destroy allocators, since the pool which created them will destroy them during that pool's cleanup phase. The pool handles it. Iconic behavior, honestly. πŸ‘‘


πŸ‘€ See Also πŸ‘€

mod_perl 2.0 documentation. β€” that's the whole reference, go read it if you're curious. πŸ¦‹


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


πŸ‘‘ Authors πŸ‘‘

The mod_perl development team and numerous contributors. Slay, team. 🫢


Kisses and clean memory, bestie πŸ’– β€” this lil page is from perl v5.42.3, dated 2023-10-21, and it's docs::a...ketAlloc(3), mwah! πŸŽ€πŸŒˆ

πŸ“¦ where this page comes from