1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/pkg
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
..
c25519 pkg/c25519: remove inexistent SHAFILE cleanup 2019-04-22 21:10:27 +02:00
cayenne-lpp pkg: remove not needed git-downloaded dependencies 2019-06-28 09:38:44 +02:00
ccn-lite pkg/ccn-lite: suppress llvm error 2019-08-05 09:36:43 +02:00
cmsis-dsp pkg: remove not needed git-downloaded dependencies 2019-06-28 09:38:44 +02:00
cn-cbor pkg: remove not needed git-downloaded dependencies 2019-06-28 09:38:44 +02:00
emb6 pkg: remove not needed git-downloaded dependencies 2019-06-28 09:38:44 +02:00
fatfs pkg: remove not needed git-downloaded dependencies 2019-06-28 09:38:44 +02:00
gecko_sdk pkg: remove not needed git-downloaded dependencies 2019-06-28 09:38:44 +02:00
hacl pkg: remove not needed git-downloaded dependencies 2019-06-28 09:38:44 +02:00
heatshrink pkg: remove not needed git-downloaded dependencies 2019-06-28 09:38:44 +02:00
jerryscript pkg: remove not needed git-downloaded dependencies 2019-06-28 09:38:44 +02:00
jsmn pkg: remove not needed git-downloaded dependencies 2019-06-28 09:38:44 +02:00
libb2 pkg: remove not needed git-downloaded dependencies 2019-06-28 09:38:44 +02:00
libcoap pkg: remove not needed git-downloaded dependencies 2019-06-28 09:38:44 +02:00
libcose pkg/libcose: update to latest master 2019-07-17 10:30:15 +02:00
libfixmath pkg: remove not needed git-downloaded dependencies 2019-06-28 09:38:44 +02:00
libhydrogen pkg: remove not needed git-downloaded dependencies 2019-06-28 09:38:44 +02:00
littlefs pkg: remove not needed git-downloaded dependencies 2019-06-28 09:38:44 +02:00
lora-serialization pkg: remove not needed git-downloaded dependencies 2019-06-28 09:38:44 +02:00
lua pkg: make use of ARRAY_SIZE macro 2019-08-06 19:43:54 +02:00
lwip Merge pull request #11946 from gschorcht/cpu/esp32/lwip_netdev 2019-08-07 08:10:03 +02:00
micro-ecc pkg: remove not needed git-downloaded dependencies 2019-06-28 09:38:44 +02:00
microcoap pkg: remove not needed git-downloaded dependencies 2019-06-28 09:38:44 +02:00
minmea pkg: remove not needed git-downloaded dependencies 2019-06-28 09:38:44 +02:00
monocypher pkg: remove not needed git-downloaded dependencies 2019-06-28 09:38:44 +02:00
nanocbor nanocbor: fix doc grouping of nanocbor_config 2019-07-12 15:41:58 +02:00
ndn-riot pkg: remove not needed git-downloaded dependencies 2019-06-28 09:38:44 +02:00
nimble pkg/nimble: adapt to nrf51 family 2019-08-07 09:53:55 +02:00
nordic_softdevice_ble pkg: make use of ARRAY_SIZE macro 2019-08-06 19:43:54 +02:00
oonf_api pkg: remove not needed git-downloaded dependencies 2019-06-28 09:38:44 +02:00
openthread pkg: make use of ARRAY_SIZE macro 2019-08-06 19:43:54 +02:00
qDSA pkg: remove not needed git-downloaded dependencies 2019-06-28 09:38:44 +02:00
relic tests/relic: move from unittests to regular test 2018-11-27 20:41:26 +01:00
semtech-loramac pkg/semtech-loramac: extended return code doc and debug msg 2019-07-22 16:12:23 +02:00
spiffs pkg: remove not needed git-downloaded dependencies 2019-06-28 09:38:44 +02:00
tiny-asn1 pkg: remove not needed git-downloaded dependencies 2019-06-28 09:38:44 +02:00
tinycbor pkg: remove not needed git-downloaded dependencies 2019-06-28 09:38:44 +02:00
tinycrypt pkg: remove not needed git-downloaded dependencies 2019-06-28 09:38:44 +02:00
tinydtls pkg: remove not needed git-downloaded dependencies 2019-06-28 09:38:44 +02:00
tlsf pkg/tlsf: Fix the way system functions are overriden. 2019-09-17 21:18:50 +02:00
tweetnacl pkg: remove not needed git-downloaded dependencies 2019-06-28 09:38:44 +02:00
u8g2 pkg: remove not needed git-downloaded dependencies 2019-06-28 09:38:44 +02:00
ubasic pkg: remove not needed git-downloaded dependencies 2019-06-28 09:38:44 +02:00
ucglib pkg: remove not needed git-downloaded dependencies 2019-06-28 09:38:44 +02:00
umorse pkg: remove not needed git-downloaded dependencies 2019-06-28 09:38:44 +02:00
wakaama pkg/wakaama: Bump to v1.0 2019-02-27 10:48:08 +01:00
doc.txt
local.mk
Makefile.git pkg: remove not needed git-downloaded dependencies 2019-06-28 09:38:44 +02:00
Makefile.http
pkg.mk pkg/pkg.mk: make sure we are building the correct commit. 2019-03-19 11:49:41 +01:00