|
ascii-chat 0.6.0
Real-time terminal-based video chat with ASCII art conversion
|
Unified buffer pool with lock-free fast path. More...
#include <lib/buffer_pool.h>
Public Member Functions | |
| _Atomic (buffer_node_t *) free_list | |
| Lock-free stack of available buffers. | |
Atomic counters @{ | |
| _Atomic (size_t) current_bytes | |
| Total bytes in pool. | |
| _Atomic (size_t) used_bytes | |
| Bytes currently in use. | |
| _Atomic (size_t) peak_bytes | |
| Peak bytes in use. | |
| _Atomic (size_t) peak_pool_bytes | |
| Peak bytes in pool. | |
| _Atomic (uint64_t) hits | |
| Allocations from free list. | |
| _Atomic (uint64_t) allocs | |
| New buffer allocations. | |
| _Atomic (uint64_t) returns | |
| Buffers returned to free list. | |
| _Atomic (uint64_t) shrink_freed | |
| Buffers freed by shrink. | |
| _Atomic (uint64_t) malloc_fallbacks | |
| Allocations that bypassed pool. | |
Data Fields | |
| mutex_t | shrink_mutex |
| Only used for shrinking. | |
| size_t | max_bytes |
| Maximum total bytes allowed. | |
| uint64_t | shrink_delay_ms |
| Time before unused buffers freed. | |
Unified buffer pool with lock-free fast path.
Definition at line 90 of file buffer_pool.h.
| buffer_pool::_Atomic | ( | buffer_node_t * | ) |
Lock-free stack of available buffers.
| buffer_pool::_Atomic | ( | size_t | ) |
Total bytes in pool.
| buffer_pool::_Atomic | ( | size_t | ) |
Peak bytes in use.
| buffer_pool::_Atomic | ( | size_t | ) |
Peak bytes in pool.
| buffer_pool::_Atomic | ( | size_t | ) |
Bytes currently in use.
| buffer_pool::_Atomic | ( | uint64_t | ) |
New buffer allocations.
| buffer_pool::_Atomic | ( | uint64_t | ) |
Allocations from free list.
| buffer_pool::_Atomic | ( | uint64_t | ) |
Allocations that bypassed pool.
| buffer_pool::_Atomic | ( | uint64_t | ) |
Buffers returned to free list.
| buffer_pool::_Atomic | ( | uint64_t | ) |
Buffers freed by shrink.
| size_t buffer_pool::max_bytes |
Maximum total bytes allowed.
Definition at line 94 of file buffer_pool.h.
Referenced by buffer_pool_create(), and buffer_pool_log_stats().
| uint64_t buffer_pool::shrink_delay_ms |
Time before unused buffers freed.
Definition at line 95 of file buffer_pool.h.
Referenced by buffer_pool_create(), and buffer_pool_shrink().
| mutex_t buffer_pool::shrink_mutex |
Only used for shrinking.
Definition at line 92 of file buffer_pool.h.
Referenced by buffer_pool_create(), buffer_pool_destroy(), and buffer_pool_shrink().