41 #if (CH_CFG_USE_MEMPOOLS == TRUE) || defined(__DOXYGEN__) 81 (size >=
sizeof(
void *)) &&
82 (align >= PORT_NATURAL_ALIGN) &&
144 "returned object not aligned");
214 #if (CH_CFG_USE_SEMAPHORES == TRUE) || defined(__DOXYGEN__)
void chGuardedPoolFree(guarded_memory_pool_t *gmp, void *objp)
Releases an object into a guarded memory pool.
uint64_t sysinterval_t
Type of time interval.
void chPoolFreeI(memory_pool_t *mp, void *objp)
Releases an object into a memory pool.
static void chSysLock(void)
Enters the kernel lock state.
msg_t chSemWaitTimeoutS(semaphore_t *sp, sysinterval_t timeout)
Performs a wait operation on a semaphore with timeout specification.
void * chGuardedPoolAllocTimeout(guarded_memory_pool_t *gmp, sysinterval_t timeout)
Allocates an object from a guarded memory pool.
memgetfunc_t provider
Memory blocks provider for this pool.
void chPoolFree(memory_pool_t *mp, void *objp)
Releases an object into a memory pool.
unsigned align
Required alignment.
memory_pool_t pool
The memory pool itself.
static void chSysUnlock(void)
Leaves the kernel lock state.
#define MEM_IS_VALID_ALIGNMENT(a)
Returns whatever a constant is a valid alignment.
void *(* memgetfunc_t)(size_t size, unsigned align)
Memory get function.
#define MEM_IS_ALIGNED(p, a)
Returns whatever a pointer or memory size is aligned.
size_t object_size
Memory pool objects size.
void chSchRescheduleS(void)
Performs a reschedule if a higher priority thread is runnable.
#define chDbgCheck(c)
Function parameters check.
static void chGuardedPoolAdd(guarded_memory_pool_t *gmp, void *objp)
Adds an object to a guarded memory pool.
struct pool_header * next
Pointer to the header.
void * chPoolAlloc(memory_pool_t *mp)
Allocates an object from a memory pool.
#define MSG_OK
Normal wakeup message.
void chSemObjectInit(semaphore_t *sp, cnt_t n)
Initializes a semaphore with the specified counter value.
static void chGuardedPoolFreeI(guarded_memory_pool_t *gmp, void *objp)
Releases an object into a guarded memory pool.
void chPoolLoadArray(memory_pool_t *mp, void *p, size_t n)
Loads a memory pool with an array of static objects.
semaphore_t sem
Counter semaphore guarding the memory pool.
void * chPoolAllocI(memory_pool_t *mp)
Allocates an object from a memory pool.
void * chGuardedPoolAllocTimeoutS(guarded_memory_pool_t *gmp, sysinterval_t timeout)
Allocates an object from a guarded memory pool.
void chDbgCheckClassI(void)
I-class functions context check.
void chPoolObjectInitAligned(memory_pool_t *mp, size_t size, unsigned align, memgetfunc_t provider)
Initializes an empty memory pool.
#define chDbgAssert(c, r)
Condition assertion.
void chGuardedPoolObjectInitAligned(guarded_memory_pool_t *gmp, size_t size, unsigned align)
Initializes an empty guarded memory pool.
static void chPoolAdd(memory_pool_t *mp, void *objp)
Adds an object to a memory pool.
Guarded memory pool descriptor.
ChibiOS/RT main include file.
void chGuardedPoolLoadArray(guarded_memory_pool_t *gmp, void *p, size_t n)
Loads a guarded memory pool with an array of static objects.