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

Function rt_system_heap_init_generic

src/kservice.c:821–832  ·  view source on GitHub ↗

* @brief This function will do the generic system heap initialization. * * @param begin_addr the beginning address of system page. * * @param end_addr the end address of system page. */

Source from the content-addressed store, hash-verified

819 * @param end_addr the end address of system page.
820 */
821void rt_system_heap_init_generic(void *begin_addr, void *end_addr)
822{
823 rt_uintptr_t begin_align = RT_ALIGN((rt_uintptr_t)begin_addr, RT_ALIGN_SIZE);
824 rt_uintptr_t end_align = RT_ALIGN_DOWN((rt_uintptr_t)end_addr, RT_ALIGN_SIZE);
825
826 RT_ASSERT(end_align > begin_align);
827
828 /* Initialize system memory heap */
829 _MEM_INIT("heap", (void *)begin_align, end_align - begin_align);
830 /* Initialize multi thread contention lock */
831 _heap_lock_init();
832}
833
834/**
835 * @brief This function will init system heap. User can override this API to

Callers 1

rt_system_heap_initFunction · 0.85

Calls 1

_heap_lock_initFunction · 0.85

Tested by

no test coverage detected