[kernel] add assert to mempool object
@@ -150,6 +150,8 @@ rt_err_t rt_mp_detach(struct rt_mempool *mp)
/* parameter check */
RT_ASSERT(mp != RT_NULL);
+ RT_ASSERT(rt_object_get_type(&mp->parent) == RT_Object_Class_MemPool);
+ RT_ASSERT(rt_object_is_systemobject(&mp->parent));
/* wake up all suspended threads */
while (!rt_list_isempty(&(mp->suspend_thread)))
@@ -266,6 +268,8 @@ rt_err_t rt_mp_delete(rt_mp_t mp)
/* parameter check */
RT_ASSERT(mp != RT_NULL);
+ RT_ASSERT(rt_object_get_type(&mp->parent) == RT_Object_Class_MemPool);
+ RT_ASSERT(rt_object_is_systemobject(&mp->parent) == RT_FALSE);
/* wake up all suspended threads */
while (!rt_list_isempty(&(mp->suspend_thread)))
