|
Barracuda Application Server C/C++ Reference
Native APIs, integration guides, and platform interfaces
|
Classes | |
| struct | FixedSizeAllocator |
| This is a fixed size allocator implementation for the abstract interface class AllocatorIntf. More... | |
Typedefs | |
| typedef FixedSizeAllocator | FixedSizeAllocator |
| This is a fixed size allocator implementation for the abstract interface class AllocatorIntf. More... | |
Functions | |
| void * | baMalloc (size_t size) |
| Allocate uninitialized storage using the target's configured allocator. More... | |
| void * | baRealloc (void *p, size_t size) |
| Resize storage using the target's configured allocator. More... | |
| void | baFree (void *p) |
| Release storage using the target's configured allocator. More... | |
| typedef FixedSizeAllocator FixedSizeAllocator |
This is a fixed size allocator implementation for the abstract interface class AllocatorIntf.
The FixedSizeAllocator takes a buffer and splits the buffer up into equally sized chunks. Allocating memory larger than the chunk size or using realloc results in an error; i.e., NULL returned. One can allocate a smaller size than the chunk size, but the size will be adjusted to the chunk size. A zero-size request or exhausted pool returns NULL and sets the requested size to zero. Free only live blocks returned by this allocator, once each; NULL is not accepted. The backing buffer remains owned by the caller and must outlive the allocator and all allocated blocks. This allocator does not lock access; callers must serialize concurrent use.
| void baFree | ( | void * | p | ) |
Release storage using the target's configured allocator.
| [in] | p | Live block from baMalloc or baRealloc. NULL handling follows the target's allocator. Do not access the block after this call. |
| void * baMalloc | ( | size_t | size | ) |
Allocate uninitialized storage using the target's configured allocator.
| [in] | size | Requested bytes. Zero-size behavior is platform-dependent. |
| void * baRealloc | ( | void * | p, |
| size_t | size | ||
| ) |
Resize storage using the target's configured allocator.
| [in] | p | Existing allocation from this allocator, or NULL. |
| [in] | size | Requested bytes. Use a positive value for portable behavior; zero-size behavior follows the target's allocator. |