Commit Graph

8 Commits

Author SHA1 Message Date
Cody P Schafer
9e1e245477 fix(heap): memalign respect malloc_alwaysinternal_limit
This changes `memalign` (and `posix_memalign`) so that it uses an
allocation method with the same selection criteria (checking
`malloc_alwaysinternal_limit` and picking one of:

- always MALLOC_CAP_INTERNAL
- MALLOC_CAP_INTERNAL first with fallback
- MALLOC_CAP_SPIRAM first with fallback

`malloc_alwaysinternal_limit` is in turn set by the options
`CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL` and
`CONFIG_SPRIAM_USE_CAPS_ALLOC`.

This notably affects folks using esp-rs to build rust code for the
esp-idf, as all allocations from rust use `memalign`.

Merges https://github.com/espressif/esp-idf/pull/12375
2023-11-01 01:58:27 +08:00
Ivan Grokhotkov
d83ce227aa newlib: implement posix_memalign, sysconf, realpath
Closes https://github.com/espressif/esp-idf/issues/6119
Closes https://github.com/espressif/esp-idf/issues/7798
2021-12-13 14:40:21 +01:00
Felipe Neves
3057b76a7e tests: re-add all disabled tests and all disabled configurations 2020-10-14 16:11:49 +11:00
Felipe Neves
bd9b921713 heap_tlsf: added implementation of TLSF allocator
heap: ported tlsf allocator into multi heap

heap_host_tests: added tlsf allocator into host test

heap_host_test: update freebytes after using free

heap_tests: tlsf now passing on host tests without poisoning

multi_heap: added support for memalign using tlsf implementation

heap_caps: removed heap_caps_aligned_free

heap/test: fixed broken aligned alloc test build

heap: added poisoning pattern when blocks are being merged

heap/tests: added timing tests for memory allocation

heap: reduced tlsf structure overhead

heap/tlsf: made all short functions inside of tlsf  module as inline to improve timings

heap: moved tlsf heap routines outside of flash memory

newlib: linked multiheap memalign with newlib memalign function

heap: moved block member functions to a separate file so multi_heap can use the functions

heap/test: improved the tlsf timing test

heap/test: added memalign on aligned alloc tests

heap: moved tlsf configuration constants to a separated file

heap: added random allocations test with timings

heap: modified the calculation of heap free bytes

heap: make aligned free true deprecated functions and update their documentation

heap: add extra assert after successive mallocs on small allocation host test

heap: remove legacy aligned alloc implementation.

performance: added malloc and free time performance default values
2020-10-13 23:52:03 +00:00
Felipe Neves
8e5ea171d3 newlib: reverted support of memalign function 2020-01-10 10:05:28 -03:00
Felipe Neves
aa100d2dfe newlib: added heap_caps_aligned_alloc on bottom of memalign 2020-01-10 10:05:28 -03:00
Anton Maklakov
afbaf74007 tools: Mass fixing of empty prototypes (for -Wstrict-prototypes) 2019-08-01 16:28:56 +07:00
Ivan Grokhotkov
5719cd6fac newlib: when compiling with GCC8, use newlib headers and libraries from toolchain 2019-04-10 13:52:30 +08:00