嵌入式技术
void print_kernel_object_size(void)
{
struct rt_object obj;
rt_kprintf("struct rt_object size=%d\\n", sizeof(obj));
rt_kprintf("rt_list_t size=%d\\n", sizeof(rt_list_t));
rt_kprintf("struct rt_timer size=%d\\n", sizeof(struct rt_timer));
rt_kprintf("struct rt_thread size=%d\\n", sizeof(struct rt_thread));
rt_kprintf("struct rt_ipc_object size=%d\\n", sizeof(struct rt_ipc_object));
rt_kprintf("struct rt_semaphore size=%d\\n", sizeof(struct rt_semaphore));
rt_kprintf("struct rt_mutex size=%d\\n", sizeof(struct rt_mutex));
rt_kprintf("struct rt_event size=%d\\n", sizeof(struct rt_event));
rt_kprintf("struct rt_mailbox size=%d\\n", sizeof(struct rt_mailbox));
rt_kprintf("struct rt_messagequeue size=%d\\n", sizeof(struct rt_messagequeue));
rt_kprintf("struct rt_mempool size=%d\\n", sizeof(struct rt_mempool));
rt_kprintf("struct rt_device size=%d\\n", sizeof(struct rt_device));
rt_kprintf("struct rt_device_graphic_info size=%d\\n", sizeof(struct rt_device_graphic_info));
}
MSH_CMD_EXPORT(print_kernel_object_size, print_kernel_object_size); //导出命令
msh / >pri
print_kernel_object_size
msh / >print_kernel_object_size
struct rt_object size=20
rt_list_t size=8
struct rt_timer size=44
struct rt_thread size=128
struct rt_ipc_object size=28
struct rt_semaphore size=32
struct rt_mutex size=36
struct rt_event size=32
struct rt_mailbox size=48
struct rt_messagequeue size=60
struct rt_mempool size=52
struct rt_device size=80
struct rt_device_graphic_info size=12
/**
* Base structure of Kernel object
*/
struct rt_object
{
char name[RT_NAME_MAX]; /**< name of kernel object */
rt_uint8_t type; /**< type of kernel object */
rt_uint8_t flag; /**< flag of kernel object */
#ifdef RT_USING_MODULE
void *module_id; /**< id of application module */
#endif
rt_list_t list; /**< list node of kernel object */
};
\\ | /
- RT - Thread Operating System
/ | \\ 4.0.3 build Jan 16 2021
2006 - 2020 Copyright by rt-thread team
thread: stack overflow
全部0条评论
快来发表一下你的评论吧 !