#include "ocs_array.h"Go to the source code of this file.
Functions | |
| ocs_pool_t * | ocs_pool_alloc (ocs_os_handle_t os, uint32_t size, uint32_t count, uint32_t use_lock) |
| Allocate a memory pool. More... | |
| void | ocs_pool_reset (ocs_pool_t *pool) |
| Reset a memory pool. More... | |
| void | ocs_pool_free (ocs_pool_t *pool) |
| Free a previously allocated memory pool. More... | |
| void * | ocs_pool_get (ocs_pool_t *pool) |
| Allocate a memory pool item. More... | |
| void | ocs_pool_put (ocs_pool_t *pool, void *item) |
| free memory pool item More... | |
| void | ocs_pool_put_head (ocs_pool_t *pool, void *item) |
| free memory pool item More... | |
| uint32_t | ocs_pool_get_count (ocs_pool_t *pool) |
| Return memory pool item count. More... | |
| void * | ocs_pool_get_instance (ocs_pool_t *pool, uint32_t idx) |
| Return item given an index. More... | |
| uint32_t | ocs_pool_get_freelist_count (ocs_pool_t *pool) |
| Return count of free objects in a pool. More... | |
| ocs_pool_t* ocs_pool_alloc | ( | ocs_os_handle_t | os, |
| uint32_t | size, | ||
| uint32_t | count, | ||
| uint32_t | use_lock | ||
| ) |
Allocate a memory pool.
A memory pool of given size and item count is allocated.
| os | OS handle. |
| size | Size in bytes of item. |
| count | Number of items in a memory pool. |
| use_lock | TRUE to enable locking of pool. |
Definition at line 88 of file ocs_pool.c.
| void ocs_pool_free | ( | ocs_pool_t * | pool | ) |
Free a previously allocated memory pool.
The memory pool is freed.
| pool | Pointer to memory pool. |
Definition at line 173 of file ocs_pool.c.
| void* ocs_pool_get | ( | ocs_pool_t * | pool | ) |
Allocate a memory pool item.
A memory pool item is taken from the free list and returned.
| pool | Pointer to memory pool. |
Definition at line 197 of file ocs_pool.c.
| uint32_t ocs_pool_get_count | ( | ocs_pool_t * | pool | ) |
Return memory pool item count.
Returns the allocated number of items.
| pool | Pointer to memory pool. |
Definition at line 291 of file ocs_pool.c.
| uint32_t ocs_pool_get_freelist_count | ( | ocs_pool_t * | pool | ) |
Return count of free objects in a pool.
The number of objects on a pool's free list.
| pool | Pointer to memory pool. |
Definition at line 335 of file ocs_pool.c.
| void* ocs_pool_get_instance | ( | ocs_pool_t * | pool, |
| uint32_t | idx | ||
| ) |
Return item given an index.
A pointer to a memory pool item is returned given an index.
| pool | Pointer to memory pool. |
| idx | Index. |
Definition at line 315 of file ocs_pool.c.
| void ocs_pool_put | ( | ocs_pool_t * | pool, |
| void * | item | ||
| ) |
free memory pool item
A memory pool item is freed.
| pool | Pointer to memory pool. |
| item | Pointer to item to free. |
Definition at line 230 of file ocs_pool.c.
| void ocs_pool_put_head | ( | ocs_pool_t * | pool, |
| void * | item | ||
| ) |
free memory pool item
A memory pool item is freed to head of list.
| pool | Pointer to memory pool. |
| item | Pointer to item to free. |
Definition at line 261 of file ocs_pool.c.
| void ocs_pool_reset | ( | ocs_pool_t * | pool | ) |
Reset a memory pool.
Place all pool elements on the free list, and zero them.
| pool | Pointer to the pool object. |
Definition at line 131 of file ocs_pool.c.