Manages a global audio buffer pool, reducing the number of memory allocation requests, increasing efficiency of audio applications.
More...
#include "SuperpoweredAudioBuffers.h"
|
static void * | getBuffer (unsigned int sizeBytes) |
| Creates a buffer with retain count set to 1, similar to an NSObject in Objective-C. More...
|
|
static void | initialize () |
| Initializes the buffer pool. More...
|
|
static void | releaseBuffer (void *buffer) |
| Release a buffer, similar to an NSObject in Objective-C (decreases the retain count by 1, the memory will be freed after retain count reaches 0). More...
|
|
static void | retainBuffer (void *buffer) |
| Retains a buffer, similar to Objective-C (increases the retain count by 1, similar to an NSObject in Objective-C). More...
|
|
Manages a global audio buffer pool, reducing the number of memory allocation requests, increasing efficiency of audio applications.
Check the offline example project on how to use.
◆ AudiobufferPool()
◆ getBuffer()
static void* Superpowered::AudiobufferPool::getBuffer |
( |
unsigned int |
sizeBytes | ) |
|
|
static |
Creates a buffer with retain count set to 1, similar to an NSObject in Objective-C.
Use releaseBuffer() to release. This method never blocks, never locks, is very fast and safe to use in a realtime thread. Can be called concurrently on any thread.
- Returns
- The buffer.
- Parameters
-
sizeBytes | The requested buffer's size in bytes. Maximum: 8388608 (8 MB). |
◆ initialize()
static void Superpowered::AudiobufferPool::initialize |
( |
| ) |
|
|
static |
Initializes the buffer pool.
◆ operator=()
◆ releaseBuffer()
static void Superpowered::AudiobufferPool::releaseBuffer |
( |
void * |
buffer | ) |
|
|
static |
Release a buffer, similar to an NSObject in Objective-C (decreases the retain count by 1, the memory will be freed after retain count reaches 0).
This method never blocks, never locks, is very fast and safe to use in a realtime thread. Can be called concurrently on any thread.
- Parameters
-
◆ retainBuffer()
static void Superpowered::AudiobufferPool::retainBuffer |
( |
void * |
buffer | ) |
|
|
static |
Retains a buffer, similar to Objective-C (increases the retain count by 1, similar to an NSObject in Objective-C).
This method never blocks, never locks, is very fast and safe to use in a realtime thread. Can be called concurrently on any thread.
- Parameters
-
◆ internals
bufferPoolInternals* Superpowered::AudiobufferPool::internals |
|
private |
The documentation for this class was generated from the following file:
- latest/Superpowered/SuperpoweredAudioBuffers.h