aboutsummaryrefslogtreecommitdiffstats
path: root/os/common/oslib/include/chmempools.h
diff options
context:
space:
mode:
Diffstat (limited to 'os/common/oslib/include/chmempools.h')
-rw-r--r--os/common/oslib/include/chmempools.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/os/common/oslib/include/chmempools.h b/os/common/oslib/include/chmempools.h
index ab763b401..25de236ce 100644
--- a/os/common/oslib/include/chmempools.h
+++ b/os/common/oslib/include/chmempools.h
@@ -252,6 +252,21 @@ static inline void chGuardedPoolAddI(guarded_memory_pool_t *gmp, void *objp) {
chGuardedPoolFreeI(gmp, objp);
}
+
+/**
+ * @brief Allocates an object from a guarded memory pool.
+ * @pre The guarded memory pool must be already been initialized.
+ *
+ * @param[in] gmp pointer to a @p guarded_memory_pool_t structure
+ * @return The pointer to the allocated object.
+ * @retval NULL if the operation timed out.
+ *
+ * @iclass
+ */
+static inline void *chGuardedPoolAllocI(guarded_memory_pool_t *gmp) {
+
+ return chPoolAllocI(&gmp->pool);
+}
#endif /* CH_CFG_USE_SEMAPHORES == TRUE */
#endif /* CH_CFG_USE_MEMPOOLS == TRUE */