RT-Thread RTOS  1.2.0
An open source embedded real-time operating system
Runtime Trace and Record
+ Collaboration diagram for 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))
 

Detailed Description

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:

Function Documentation

◆ rt_malloc_sethook()

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

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

Parameters
hookthe hook function.

◆ rt_realloc_set_entry_hook()

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

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

Parameters
hookthe hook function.

◆ rt_realloc_set_exit_hook()

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

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

Parameters
hookthe hook function.

◆ rt_free_sethook()

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

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

Parameters
hookthe hook function