MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_free

Function rt_free

src/kservice.c:933–946  ·  view source on GitHub ↗

* @brief This function will release the previously allocated memory block by * rt_malloc. The released memory block is taken back to system heap. * * @param ptr the address of memory which will be released. */

Source from the content-addressed store, hash-verified

931 * @param ptr the address of memory which will be released.
932 */
933rt_weak void rt_free(void *ptr)
934{
935 rt_base_t level;
936
937 /* call 'rt_free' hook */
938 RT_OBJECT_HOOK_CALL(rt_free_hook, (&ptr));
939 /* NULL check */
940 if (ptr == RT_NULL) return;
941 /* Enter critical zone */
942 level = _heap_lock();
943 _MEM_FREE(ptr);
944 /* Exit critical zone */
945 _heap_unlock(level);
946}
947RTM_EXPORT(rt_free);
948
949/**

Callers 15

finsh_set_promptFunction · 0.85
msh_exec_scriptFunction · 0.85
cmd_mvFunction · 0.85
directory_delete_for_mshFunction · 0.85
directory_setattrFunction · 0.85
msh_exec_moduleFunction · 0.85
_msh_exec_search_pathFunction · 0.85
_msh_exec_search_envFunction · 0.85
_msh_exec_lwpFunction · 0.85
msh_auto_complete_pathFunction · 0.85
fal_partition_initFunction · 0.85

Calls 2

_heap_lockFunction · 0.85
_heap_unlockFunction · 0.85

Tested by 15

uart_tx_demoFunction · 0.68
utest_tc_initFunction · 0.68
utest_tc_cleanupFunction · 0.68
ic_rx_threadFunction · 0.68
nand_thread_entryFunction · 0.68
ssd1306_write_mult_regFunction · 0.68
sdmmc_thread_entryFunction · 0.68
udpecho_socket_entryFunction · 0.68
tcpecho_socket_entryFunction · 0.68
_block_device_testFunction · 0.68