QP/C
Functions
qmp_put.c File Reference

QMPool_put() implementation. More...

#include "qf_pkg.h"
#include "qassert.h"

Go to the source code of this file.

Functions

void QMPool_put (QMPool *me, void *b)
 Returns a memory block back to a memory pool.

Detailed Description

QMPool_put() implementation.

Definition in file qmp_put.c.


Function Documentation

void QMPool_put ( QMPool me,
void *  b 
)

Returns a memory block back to a memory pool.

The first parameter me is a pointer to the QMPool to which the block is returned. The second parameter is the pointer to the returned memory block.

This function can be called from any task level or ISR level.

Note:
The block must be allocated from the same memory pool to which it is returned. The QMPool_put() function raises an assertion if the returned pointer to the block points outside of the original memory buffer managed by the memory pool. Also, the QMPool_put() function uses internally a QF critical section, so you should be careful not to call it from within a critical section when nesting of critical section is not supported.
See also:
QMPool_get()

Definition at line 48 of file qmp_put.c.

References QMPool::end, QMPool::free_head, QMPool::nFree, QMPool::nTot, Q_REQUIRE, QS_BEGIN_NOCRIT_, QS_END_NOCRIT_, QS_mpObj_, QS_OBJ_, QS_QF_MPOOL_PUT, QS_TIME_, and QMPool::start.