|
IntrOS
|
memory pools (objects of a fixed size) More...
Macros | |
| #define | OS_MEM_BUFFER(buf, limit, size) |
| define memory pool data buffer | |
| #define | OS_MEM(mem, limit, size) |
| define and initialize a memory pool object | |
| #define | static_MEM(mem, limit, size) |
| static alias of OS_MEM() | |
| #define | MEM_INIT(limit, size) |
| create and initialize a memory pool object | |
| #define | MEM_CREATE(limit, size) |
| create and initialize a memory pool object | |
| #define | MEM_NEW MEM_CREATE |
| alias of MEM_CREATE() | |
Functions | |
| void | mem_init (mem_t *mem, size_t size, que_t *data, size_t bufsize) |
| initialize a memory pool object | |
| void | mem_reset (mem_t *mem) |
| reset the memory pool object and wake up all waiting tasks with 'E_STOPPED' event value | |
| void | mem_kill (mem_t *mem) |
| alias of mem_reset() | |
| int | mem_take (mem_t *mem, void **data) |
| try to get memory object from the memory pool object, don't wait if the memory pool object is empty | |
| int | mem_tryWait (mem_t *mem, void **data) |
| alias of mem_take() | |
| int | mem_waitFor (mem_t *mem, void **data, cnt_t delay) |
| try to get memory object from the memory pool object, wait for given duration of time while the memory pool object is empty | |
| int | mem_waitUntil (mem_t *mem, void **data, cnt_t time) |
| try to get memory object from the memory pool object, wait until given timepoint while the memory pool object is empty | |
| int | mem_wait (mem_t *mem, void **data) |
| try to get memory object from the memory pool object, wait indefinitely while the memory pool object is empty | |
| void | mem_give (mem_t *mem, void *data) |
| transfer memory object to the memory pool object, | |
memory pools (objects of a fixed size)
| #define OS_MEM_BUFFER | ( | buf, | |
| limit, | |||
| size ) |
define memory pool data buffer
| buf | name of the buffer (passed to the init function) |
| limit | size of a buffer (max number of objects) |
| size | size of memory object (in bytes) |
| #define OS_MEM | ( | mem, | |
| limit, | |||
| size ) |
define and initialize a memory pool object
| mem | name of a pointer to memory pool object |
| limit | size of a buffer (max number of objects) |
| size | size of memory object (in bytes) |
| #define static_MEM | ( | mem, | |
| limit, | |||
| size ) |
static alias of OS_MEM()
| #define MEM_INIT | ( | limit, | |
| size ) |
create and initialize a memory pool object
| limit | size of a buffer (max number of objects) |
| size | size of memory object (in bytes) |
| #define MEM_CREATE | ( | limit, | |
| size ) |
create and initialize a memory pool object
| limit | size of a buffer (max number of objects) |
| size | size of memory object (in bytes) |
| void mem_init | ( | mem_t * | mem, |
| size_t | size, | ||
| que_t * | data, | ||
| size_t | bufsize ) |
initialize a memory pool object
| mem | pointer to memory pool object |
| size | size of memory object (in bytes) |
| data | memory pool data buffer |
| bufsize | size of the data buffer (in bytes) |
| void mem_reset | ( | mem_t * | mem | ) |
reset the memory pool object and wake up all waiting tasks with 'E_STOPPED' event value
| mem | pointer to memory pool object |
| int mem_take | ( | mem_t * | mem, |
| void ** | data ) |
try to get memory object from the memory pool object, don't wait if the memory pool object is empty
| mem | pointer to memory pool object |
| data | pointer to store the pointer to the memory object |
| int mem_waitFor | ( | mem_t * | mem, |
| void ** | data, | ||
| cnt_t | delay ) |
try to get memory object from the memory pool object, wait for given duration of time while the memory pool object is empty
| mem | pointer to memory pool object |
| data | pointer to store the pointer to the memory object |
| delay | duration of time (maximum number of ticks to wait while the memory pool object is empty)
|
| int mem_waitUntil | ( | mem_t * | mem, |
| void ** | data, | ||
| cnt_t | time ) |
try to get memory object from the memory pool object, wait until given timepoint while the memory pool object is empty
| mem | pointer to memory pool object |
| data | pointer to store the pointer to the memory object |
| time | timepoint value |
|
inline |
try to get memory object from the memory pool object, wait indefinitely while the memory pool object is empty
| mem | pointer to memory pool object |
| data | pointer to store the pointer to the memory object |
| void mem_give | ( | mem_t * | mem, |
| void * | data ) |
transfer memory object to the memory pool object,
| mem | pointer to memory pool object |
| data | pointer to memory object |