1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

10 Commits

Author SHA1 Message Date
Karl Fessel
05f114d0af doc: fix unbalaced grouping
- most were trivial
    - missing group close or open
    - extra space
    - no doxygen comment
- name commad might open an implicit group
    this hould also be implicit cosed but does not happen somtimes
- crazy: internal declared groups have to be closed internal
2022-09-14 15:05:25 +02:00
Jan Romann
4384795cb9
treewide: Remove excessive newlines 2021-08-13 19:50:38 +02:00
Marian Buschsieweke
84169266b4
pkg/tlsf: fix possible overflow in calloc implementation 2021-05-05 08:58:31 +02:00
9ac32c6dd7 pkg/tlsf: fix typos 2019-11-23 22:39:38 +01:00
Juan Carrano
cc907fa54e pkg/tlsf: Fix the way system functions are overriden.
The correct way to overrride the malloc family of functions in newlib-nano is
to provide the *_r (reentrant) variants. Newlib implements the "normal"
functions on top of these (see the newlib source code). Also, internally it calls
the *_r functions when allocating buffers.

If only the "normal" non-reentrant functions are provided this will mean that
some of the code will still use the vanilla newlib allocator. Furthermore, if
one uses the whole heap as a pool for TLSF then the system may in the best case
crash as there is no enough memory for its internall allocations or in the worst
case function eratically (this depends on how the heap reserved, there is an
upcomming series of commits in that direction).

This commit splits the handling between newlib and native. It also prepares the
ground for future work on the pool initialization.

Right now I could only test this in ARM and native and I cannot ensure it will
work on other platforms. Replacing the system's memory allocator is not something
that can be taken lightly and will inevitably require diving into the depths of
the libc. Therefore I would say that using TLSF as a system wide allocator is ATM
supported officially only on those plaftorms.

Testing:

Aside from reading the newlib sources, you can see the issue in a live system
using the debugger.

Compile any example (with or without tlsf-malloc), grab a debugger and place
a breakpoint in sbrk and _sbrk_r. Doing a backtrace will reveal it gets called
by _malloc_r.
2019-09-17 21:18:50 +02:00
Juan Carrano
ad4d883c4f pkg/tlsf: fix double pointer.
A (void*) function was declared as (void**) because one of the void pointers
was hidden behind a typedef. Because of the way a void* works, this has no
consequences, but it is confusing.
2019-08-16 19:17:32 +02:00
Jose Alamos
6089f4a10c doc/mem_management: add implementations and utils 2018-09-27 10:54:39 +02:00
Martine Lenders
82c318224b tlsf: fix for llvm
The `__GNUC__` is also available in `clang` as is just used to provide
the major version of a GNU-C compatible compiler [[1]]. So I check for
`tlsf` if the `alloc_size()` is available by using the combination of
macros as proposed here: https://stackoverflow.com/a/43205345/395687

[1]: https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html
2018-07-31 21:35:29 +02:00
Cenk Gündoğan
0009213072 tlsf: add custom walker to get total free / used sizes 2018-06-12 09:43:48 +02:00
Juan Carrano
cf686bde2d pkg/tlsf: Refactor the TLSF package and bring back original TLSF api.
- Cleanup package makefile.
- Download directly from git.
- Remove giant patch.
- Implement malloc function as a contrib package.
- Update ccn example.
- Update ps command.
2018-05-18 15:41:07 +02:00