RTEMS | Add TLSF allocator implementation to RTEMS (#5633)

mazen Adel (@mez3n) gitlab at rtems.org
Thu Aug 6 02:15:57 UTC 2026




mazen Adel commented: https://gitlab.rtems.org/rtems/rtos/rtems/-/work_items/5633#note_156479


We currently have a working TLSF implementation tested on both 32-bit xilinx_zynq_a9_qemu and 64-bit riscv/rv64imafdc.

However not all the old first-fit APIs are supported, this stems from the design difference and that the old implementation has a lot of very specific functions.

Currently the TLSF allocator supports 2 sets of functions.

1. What I would call the classic interface functions those are the functions that it inherited from the original TLSF implementation.
2. RTEMS interface functions: Those were implemented in an effort to provide an interface between RTEMS heap API and the actual implementation of the heap (required for modular heap support).

The classic interface list:

* \_Heap_Tlsf_Control_size()
* \_Heap_Tlsf_Align_size()
* \_Heap_Tlsf_Block_size_min()
* \_Heap_Tlsf_Block_size_max()
* \_Heap_Tlsf_Pool_overhead()
* \_Heap_Tlsf_Allocation_overhead()
* \_Heap_Tlsf_Create()
* \_Heap_Tlsf_Create_with_pool()
* \_Heap_Tlsf_Destroy()
* \_Heap_Tlsf_Get_pool()
* \_Heap_Tlsf_Add_pool()
* \_Heap_Tlsf_Remove_pool()
* \_Heap_Tlsf_Allocate()
* \_Heap_Tlsf_Allocate_aligned()
* \_Heap_Tlsf_Free()
* \_Heap_Tlsf_Reallocate()
* \_Heap_Tlsf_Get_block_size()
* \_Heap_Tlsf_Walk_pool()
* \_Heap_Tlsf_Check()
* \_Heap_Tlsf_Check_pool()

The Current implemented TLSF RTEMS interface functions list:

- \_Heap_TLSF_Initialize()
- \_Heap_TLSF_Allocate_aligned_with_boundary()
- \_Heap_TLSF_Free()
- \_Heap_TLSF_Size_of_alloc_area()

The interface functions that need to be supported to have the same exact set as first-fit

* \_Heap_TLSF_Walk()
* \_Heap_TLSF_Iterate() 
* \_Heap_TLSF_Greedy_allocate()
* \_Heap_TLSF_Greedy_allocate_all_except_largest()
* \_Heap_TLSF_Greedy_free()
* \_Heap_TLSF_Get_information()
* \_Heap_TLSF_Get_free_information()
* \_Heap_TLSF_Resize_block()
* \_Heap_TLSF_Block_allocate()
* \_Heap_TLSF_Extend()
* \_Heap_TLSF_Get_first_and_last_block()

Some of them are more important than the others and some are similar in name only to the ones implemented by the TLSF classic interface.

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/work_items/5633#note_156479
You're receiving this email because of your account on gitlab.rtems.org. Unsubscribe from this thread: https://gitlab.rtems.org/-/sent_notifications/5-d8ucstya4mpr4kfongk6zn7wg-1d/unsubscribe | Manage all notifications: https://gitlab.rtems.org/-/profile/notifications | Help: https://gitlab.rtems.org/help


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20260806/ee2c6483/attachment.htm>


More information about the bugs mailing list