RT-Thread RTOS 1.2.0
An open source embedded real-time operating system
载入中...
搜索中...
未找到
Runtime Trace and Record
+ Runtime Trace and Record 的协作图:
void rt_malloc_sethook (void(*hook)(void **ptr, rt_size_t size))
 
void rt_realloc_set_entry_hook (void(*hook)(void **ptr, rt_size_t size))
 
void rt_realloc_set_exit_hook (void(*hook)(void **ptr, rt_size_t size))
 
void rt_free_sethook (void(*hook)(void **ptr))
 

详细描述

the hook function set in runtime

In order to trace and record RT-Thread activity in runtime, a hook mechanism is introduced.

The hooks are a series of routines, which are invoked in some special checkpoints. The hook routines include:

函数说明

◆ rt_malloc_sethook()

void rt_malloc_sethook ( void(* hook )(void **ptr, rt_size_t size))

This function will set a hook function, which will be invoked when a memory block is allocated from heap memory.

参数
hookthe hook function.

在文件 kservice.c602 行定义.

603{
604 rt_malloc_hook = hook;
605}

◆ rt_realloc_set_entry_hook()

void rt_realloc_set_entry_hook ( void(* hook )(void **ptr, rt_size_t size))

This function will set a hook function, which will be invoked when a memory block is allocated from heap memory.

参数
hookthe hook function.

在文件 kservice.c613 行定义.

614{
615 rt_realloc_entry_hook = hook;
616}

◆ rt_realloc_set_exit_hook()

void rt_realloc_set_exit_hook ( void(* hook )(void **ptr, rt_size_t size))

This function will set a hook function, which will be invoked when a memory block is allocated from heap memory.

参数
hookthe hook function.

在文件 kservice.c624 行定义.

625{
626 rt_realloc_exit_hook = hook;
627}

◆ rt_free_sethook()

void rt_free_sethook ( void(* hook )(void **ptr))

This function will set a hook function, which will be invoked when a memory block is released to heap memory.

参数
hookthe hook function

在文件 kservice.c635 行定义.

636{
637 rt_free_hook = hook;
638}