|
OpenLcbCLib 1.0 Alpha
OpenSource C Library to create OpenLcb/Lcc Nodes
|
Pre-allocated message pool for OpenLCB buffer management. More...
Functions | |
| void | OpenLcbBufferStore_initialize (void) |
| Initializes the buffer store. | |
| openlcb_msg_t * | OpenLcbBufferStore_allocate_buffer (payload_type_enum payload_type) |
| Allocates a buffer from the specified pool. | |
| void | OpenLcbBufferStore_free_buffer (openlcb_msg_t *msg) |
| Decrements the reference count; frees the buffer when it reaches zero. | |
| uint16_t | OpenLcbBufferStore_basic_messages_allocated (void) |
| Returns the number of BASIC messages currently allocated. | |
| uint16_t | OpenLcbBufferStore_basic_messages_max_allocated (void) |
| Returns the peak number of BASIC messages allocated simultaneously. | |
| uint16_t | OpenLcbBufferStore_datagram_messages_allocated (void) |
| Returns the number of DATAGRAM messages currently allocated. | |
| uint16_t | OpenLcbBufferStore_datagram_messages_max_allocated (void) |
| Returns the peak number of DATAGRAM messages allocated simultaneously. | |
| uint16_t | OpenLcbBufferStore_snip_messages_allocated (void) |
| Returns the number of SNIP messages currently allocated. | |
| uint16_t | OpenLcbBufferStore_snip_messages_max_allocated (void) |
| Returns the peak number of SNIP messages allocated simultaneously. | |
| uint16_t | OpenLcbBufferStore_stream_messages_allocated (void) |
| Returns the number of STREAM messages currently allocated. | |
| uint16_t | OpenLcbBufferStore_stream_messages_max_allocated (void) |
| Returns the peak number of STREAM messages allocated simultaneously. | |
| void | OpenLcbBufferStore_inc_reference_count (openlcb_msg_t *msg) |
| Increments the reference count on an allocated buffer. | |
| void | OpenLcbBufferStore_clear_max_allocated (void) |
| Resets all peak allocation counters to zero. | |
Pre-allocated message pool for OpenLCB buffer management.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Uses segregated pools for BASIC, DATAGRAM, SNIP, and STREAM payload sizes. Reference counting supports shared buffers across multiple queues.
| void OpenLcbBufferStore_initialize | ( | void | ) |
Initializes the buffer store.
Algorithm:
| openlcb_msg_t * OpenLcbBufferStore_allocate_buffer | ( | payload_type_enum | payload_type | ) |
Allocates a buffer from the specified pool.
Algorithm:
* @param payload_type Type of buffer requested (BASIC, DATAGRAM, SNIP, or STREAM) *
| void OpenLcbBufferStore_free_buffer | ( | openlcb_msg_t * | msg | ) |
Decrements the reference count; frees the buffer when it reaches zero.
Algorithm:
* @param msg Pointer to @ref openlcb_msg_t to release (NULL is safe) *
| uint16_t OpenLcbBufferStore_basic_messages_allocated | ( | void | ) |
Returns the number of BASIC messages currently allocated.
| uint16_t OpenLcbBufferStore_basic_messages_max_allocated | ( | void | ) |
Returns the peak number of BASIC messages allocated simultaneously.
| uint16_t OpenLcbBufferStore_datagram_messages_allocated | ( | void | ) |
Returns the number of DATAGRAM messages currently allocated.
| uint16_t OpenLcbBufferStore_datagram_messages_max_allocated | ( | void | ) |
Returns the peak number of DATAGRAM messages allocated simultaneously.
| uint16_t OpenLcbBufferStore_snip_messages_allocated | ( | void | ) |
Returns the number of SNIP messages currently allocated.
| uint16_t OpenLcbBufferStore_snip_messages_max_allocated | ( | void | ) |
Returns the peak number of SNIP messages allocated simultaneously.
| uint16_t OpenLcbBufferStore_stream_messages_allocated | ( | void | ) |
Returns the number of STREAM messages currently allocated.
| uint16_t OpenLcbBufferStore_stream_messages_max_allocated | ( | void | ) |
Returns the peak number of STREAM messages allocated simultaneously.
| void OpenLcbBufferStore_inc_reference_count | ( | openlcb_msg_t * | msg | ) |
Increments the reference count on an allocated buffer.
| msg | Pointer to the openlcb_msg_t to share. |
| void OpenLcbBufferStore_clear_max_allocated | ( | void | ) |
Resets all peak allocation counters to zero.
Copyright (c) 2026 Jim Kueneman all rights reserved. See the License