* @brief This function will detach a static object from object system, * and the memory of static object is not freed. * * @param object the specified object to be detached. */
| 438 | * @param object the specified object to be detached. |
| 439 | */ |
| 440 | void rt_object_detach(rt_object_t object) |
| 441 | { |
| 442 | rt_base_t level; |
| 443 | struct rt_object_information *information; |
| 444 | |
| 445 | /* object check */ |
| 446 | RT_ASSERT(object != RT_NULL); |
| 447 | |
| 448 | RT_OBJECT_HOOK_CALL(rt_object_detach_hook, (object)); |
| 449 | |
| 450 | information = rt_object_get_information((enum rt_object_class_type)object->type); |
| 451 | RT_ASSERT(information != RT_NULL); |
| 452 | |
| 453 | level = rt_spin_lock_irqsave(&(information->spinlock)); |
| 454 | /* remove from old list */ |
| 455 | rt_list_remove(&(object->list)); |
| 456 | rt_spin_unlock_irqrestore(&(information->spinlock), level); |
| 457 | |
| 458 | object->type = RT_Object_Class_Null; |
| 459 | } |
| 460 | |
| 461 | #ifdef RT_USING_HEAP |
| 462 | /** |