/* This function will copy the object pointer of the specified type, with the maximum size specified by maxlen. */
int rt_object_get_pointers(enum rt_object_class_type type, rt_object_t *pointers, int maxlen)
/* This function will copy the object pointer of the specified type, with the maximum size specified by maxlen. */
int rt_object_get_pointers(enum rt_object_class_type type, rt_object_t *pointers, int maxlen)
{
    int index = 0;
    rt_ubase_t level;
    struct rt_object *object;
    struct rt_list_node *node = RT_NULL;
    struct rt_object_information *information = RT_NULL;
    if (maxlen <= 0) return 0;
    information = rt_object_get_information((enum rt_object_class_type)type);
    if (information == RT_NULL) return 0;
    level = rt_hw_interrupt_disable();
    rt_list_for_each(node, &(information->object_list))
    {
        object = rt_list_entry(node, struct rt_object, list);
        pointers[index] = object;
        index ++;
        if (index >= maxlen) break;
    }
    rt_hw_interrupt_enable(level);
    return index;
}