aboutsummaryrefslogtreecommitdiffstats
path: root/os/common/oslib/include/chmempools.h
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2017-10-02 14:51:07 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2017-10-02 14:51:07 +0000
commit52f6af16df6b4b6f2a45be44c306053cc543109b (patch)
tree6089116b02283f0ee163ca792d5161928d59f075 /os/common/oslib/include/chmempools.h
parent011329ed906cfbf1d019e1a06cd000f2494451ee (diff)
downloadChibiOS-52f6af16df6b4b6f2a45be44c306053cc543109b.tar.gz
ChibiOS-52f6af16df6b4b6f2a45be44c306053cc543109b.tar.bz2
ChibiOS-52f6af16df6b4b6f2a45be44c306053cc543109b.zip
Adjustments to the new code.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10745 35acf78f-673a-0410-8e92-d51de3d6d3f4
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 */