|
Modbus Vault v1.0
|
Implementation of the slab pool. More...
Data Structures | |
| struct | slab_node_t |
| Slab Pool internal node structure. More... | |
Functions | |
| static void | pool_lock_take (void) |
| Lock pool. | |
| static void | pool_lock_give (void) |
| Unlock pool. | |
| esp_err_t | slab_pool_init (void) |
| Initialize slab pool. | |
| slab_pool_t * | slab_pool_alloc (void) |
| Allocate a slab from pool. | |
| void | slab_pool_free (slab_pool_t *slab_ptr) |
| Return slab to pool. | |
| void | slab_pool_deinit (void) |
| Deinitialize slab pool. | |
Variables | |
| static const char * | TAG = "SLAB_POOL" |
| static slab_node_t | pool [SLAB_POOL_SIZE] |
| static slab_node_t * | free_list = NULL |
| static SemaphoreHandle_t | pool_lock = NULL |
| static bool | is_slab_pool_initialized = false |
Implementation of the slab pool.
| slab_pool_t * slab_pool_alloc | ( | void | ) |
Allocate a slab from pool.
| void slab_pool_free | ( | slab_pool_t * | slab_ptr | ) |
Return slab to pool.
| slab_ptr | Pointer to slab structure |
| esp_err_t slab_pool_init | ( | void | ) |
Initialize slab pool.
| ESP_OK | Initialize success |
| ESP_ERR_NO_MEM | No available memory for resource allocation |
| ESP_ERR_INVALID_STATE | Already initialized |
|
static |
Slab pool list head
|
static |
Slab pool initialization state
|
static |
Slab pool list
|
static |
Slab pool list lock
|
static |
Slab pool TAG name