| 
    µEvLoop
    
   A fast and lightweight event loop aimed at embedded platforms in C99. 
   | 
 
 
 
 
Go to the documentation of this file.
    6 #ifndef UEL_OBJECT_POOL_H 
    7 #define UEL_OBJECT_POOL_H 
   85 #define UEL_DECLARE_OBJPOOL_BUFFERS(type, size_log2n, id)           \ 
   86     type id##_pool_buffer[(1<<size_log2n)];                         \ 
   87     void *id##_pool_queue_buffer[1<<size_log2n] 
   96 #define UEL_OBJPOOL_BUFFERS(id)                                     \ 
   97     (uint8_t *)&id##_pool_buffer, id##_pool_queue_buffer 
  109 #define UEL_OBJPOOL_BUFFERS_IN(id, obj)                             \ 
  110     (uint8_t *)&obj.id##_pool_buffer, obj.id##_pool_queue_buffer 
  122 #define UEL_OBJPOOL_BUFFERS_AT(id, obj)                             \ 
  123     (uint8_t *)&obj->id##_pool_buffer, obj->id##_pool_queue_buffer 
  
bool uel_objpool_is_empty(uel_objpool_t *pool)
Checks if a pool is depleted.
 
uint8_t * buffer
The buffer that contains each object managed by this pool.
Definition: object-pool.h:29
 
void * uel_objpool_acquire(uel_objpool_t *pool)
Acquires an object from the pool.
 
bool uel_objpool_release(uel_objpool_t *pool, void *element)
Releases an object to the pool.
 
Defines circular queues, fast and efficient FIFO data structures.
 
uel_cqueue_t queue
The queue containing the addresses for each object in the pool.
Definition: object-pool.h:31
 
Pre-allocated memory bound to speciffic types suitable for providing dynamic object management in the...
Definition: object-pool.h:27
 
void uel_objpool_init(uel_objpool_t *pool, size_t size_log2n, size_t item_size, uint8_t *buffer, void **queue_buffer)
Initialises an object pool.