You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Got this working on a cortex-m embedded system with the global allocator. It'd be really helpful to have some metrics to know how much is used, fragmentation wastage, etc. Regardless, thanks for the implementation! Works great so far 👍
The text was updated successfully, but these errors were encountered:
Hi, sorry for the late response. I have been working on a block enumeration API in the feat-inspection branch. It provides Tlsf::iter_blocks, which returns an iterator over blocks in a specified pool (a contiguous memory block added by insert_free_block_ptr). Does this look good for your use case?
It requires specifying a pool manually because Tlsf doesn't track information about inserted pools at all (it only knows about free memory blocks). It doesn't support inspecting the pools inserted by insert_free_block (the method that takes &mut [_] in lieu of *mut [_]) because I'm uncertain whether it can be done safely under the Stacked Borrows model.
Yup, looks like that iterator would do the trick. My use case is primarily monitoring how much space is actually available to allocate, which if I understand the Tlsf algorithm correctly is effectively block occupancy (I think? :). Looks like using that branch I can combine is_occupied and max_payload_size to get an upper bound for both available memory and an upper bound for memory allocated (where mem_allocated + mem_available <= total_mem_in_blocks due to overhead and not-completely-filled blocks).
Heya!
Got this working on a cortex-m embedded system with the global allocator. It'd be really helpful to have some metrics to know how much is used, fragmentation wastage, etc. Regardless, thanks for the implementation! Works great so far 👍
The text was updated successfully, but these errors were encountered: