Skip to content

Commit 8137e2d

Browse files
committed
Switch all ports to auto-growing split heap
This simplifies allocating outside of the VM because the VM doesn't take up all remaining memory by default. On ESP we delegate to the IDF for allocations. For all other ports, we use TLSF to manage an outer "port" heap. The IDF uses TLSF internally and we use their fork for the other ports. This also removes the dynamic C stack sizing. It wasn't often used and is not possible with a fixed outer heap. Fixes #8512. Fixes #7334.
1 parent 648c141 commit 8137e2d

File tree

91 files changed

+660
-1438
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+660
-1438
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,3 +351,6 @@
351351
[submodule "lib/certificates"]
352352
path = lib/certificates
353353
url = https://github.com/adafruit/certificates
354+
[submodule "lib/tlsf"]
355+
path = lib/tlsf
356+
url = https://github.com/espressif/tlsf.git

lib/libm/fabsf.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*****************************************************************************/
2+
/*****************************************************************************/
3+
// fabsf from musl-0.9.15
4+
/*****************************************************************************/
5+
/*****************************************************************************/
6+
7+
#include "libm.h"
8+
9+
float fabsf(float x)
10+
{
11+
union {float f; uint32_t i;} u = {x};
12+
u.i &= 0x7fffffff;
13+
return u.f;
14+
}

lib/tlsf

Submodule tlsf added at 8c9cd05

locale/circuitpython.pot

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,10 +1271,6 @@ msgstr ""
12711271
msgid "Invalid BSSID"
12721272
msgstr ""
12731273

1274-
#: main.c
1275-
msgid "Invalid CIRCUITPY_PYSTACK_SIZE\n"
1276-
msgstr ""
1277-
12781274
#: shared-bindings/wifi/Radio.c
12791275
msgid "Invalid MAC address"
12801276
msgstr ""
@@ -2164,7 +2160,7 @@ msgid "Unable to allocate buffers for signed conversion"
21642160
msgstr ""
21652161

21662162
#: supervisor/shared/safe_mode.c
2167-
msgid "Unable to allocate the heap."
2163+
msgid "Unable to allocate to the heap."
21682164
msgstr ""
21692165

21702166
#: ports/espressif/common-hal/busio/I2C.c
@@ -2735,7 +2731,7 @@ msgstr ""
27352731
msgid "can't set attribute"
27362732
msgstr ""
27372733

2738-
#: py/runtime.c shared-bindings/supervisor/Runtime.c
2734+
#: py/runtime.c
27392735
msgid "can't set attribute '%q'"
27402736
msgstr ""
27412737

@@ -3004,12 +3000,6 @@ msgstr ""
30043000
msgid "error = 0x%08lX"
30053001
msgstr ""
30063002

3007-
#: ports/espressif/common-hal/espcamera/Camera.c
3008-
msgid ""
3009-
"espcamera.Camera requires reserved PSRAM to be configured. See the "
3010-
"documentation for instructions."
3011-
msgstr ""
3012-
30133003
#: py/runtime.c
30143004
msgid "exceptions must derive from BaseException"
30153005
msgstr ""

0 commit comments

Comments
 (0)