pkg/tlsf: add documentation. - #8994
Conversation
|
Also, there's a big patch being applied, and it's not very clear what it does. It changes the TLSF api, which is a problem since now there is no way for the user to find the correct docs for the new api. Also, the patch removes one of the features of TLSF, that is the possibility of not having any global state, that is, functions of the form As far a I can tell, no one is using TLSF directly, other code in RIOT uses vanilla malloc/free. This means that malloc/free could be implemented in terms of the unmodified API, and the global heap could be defined in the unit that defines malloc/free/etc. I want to be able to use the original TLSF functions to be able to isolate the memory for the Lua interpreter. |
|
hi @jcarrano The patch allows the usage of TLSF as the global malloc/free implementation. Concerning the isolated TLSF environments, I'm pretty sure @OlegHahm or @Kijewski has more information about why it was implemented this way.
Not sure if it's the best to put the tlsf link there, since Oneway Malloc is a specific implementation for platforms that don't implement malloc and free in the toolchain. Maybe a Memory Allocator entry which points to Oneway Malloc and TLSF? Opinions? |
| * @defgroup pkg_tlsf Two-Level Segregated Fit memory allocator | ||
| * @ingroup pkg | ||
| * @brief TLSF is a general purpose dynamic memory allocator specifically | ||
| * designed to meet real-time requirements: |
There was a problem hiding this comment.
Colon in the end. Should be dot.
| * - Works on a user supplied block of memory instead of a global heap. | ||
| * - Efficient both in terms of memory overhead and processor time. | ||
| * - Low fragmentation. | ||
| * |
| * | ||
| * @note You should prefer statically allocated memory whenever possible. | ||
| * | ||
| * @see pkg_tlsf |
If that's the case, then it's a good reason for linking the docs. If the platform does not implement malloc/free then the user will try to look at an external implementation. About the patch, that's another issue, I asked about it in the devel mailing list. For this PR I only care about documentation. |
|
I think we can drop this one now the the real tlsf patch (#9006 ) is being merged. |
|
@jcarrano Can you reference your real patch? and if it's already merged? |
|
Thanks! |
The doc.txt for TLSF was empty, so it wouldn't show up in Doxygen. I wrote a brief description and also cross linked it from the "Oneway Malloc" docs, so that people looking for memory allocation can find it.