Memory slab provide abstraction layer for memory chunks.
More...
#include "freertos/FreeRTOS.h"
#include "freertos/semphr.h"
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
Go to the source code of this file.
Memory slab provide abstraction layer for memory chunks.
- Author
- Abanoub Salah
- Thread-safe interface
- Designed to provide ready memory-pool to any layer.
◆ SLAB_POOL_MAX_DATA_SIZE
| #define SLAB_POOL_MAX_DATA_SIZE (512U) |
Slab pool data maximum size
◆ SLAB_POOL_SIZE
| #define SLAB_POOL_SIZE (32U) |
◆ slab_pool_alloc()
Allocate a slab from pool.
- Returns
- slab_pool_t* pointer to slab on success otherwise NULL
◆ slab_pool_free()
Return slab to pool.
- Parameters
-
| slab_ptr | Pointer to slab structure |
◆ slab_pool_init()
| esp_err_t slab_pool_init |
( |
void |
| ) |
|
Initialize slab pool.
- Returns
- esp_err_t Initialize result
- Return values
-
| ESP_OK | Initialize success |
| ESP_ERR_NO_MEM | No available memory for resource allocation |
| ESP_ERR_INVALID_STATE | Already initialized |