Commit graph

17 commits

Author SHA1 Message Date
Felipe Neves
4a9160a72c multi_heap: ensure that malloc(0) return NULL pointer in any poisoning configuration 2020-03-27 14:39:23 -03:00
Angus Gratton
1fac58deb7 heap: Add integer overflow checks on MALLOC_CAP_32BIT & MALLOC_CAP_EXEC 2019-03-20 18:30:17 +11:00
Renz Bagaporo
cc774111bf cmake: Add support for test build 2018-10-20 12:07:24 +08:00
Ivan Grokhotkov
ed546797d0 heap: test: don’t warn about oversized mallocs 2018-08-29 14:40:28 +08:00
Angus Gratton
bfc6bb97c0 heap: Fix heap metadata test to account for background memory allocations 2018-07-30 11:41:30 +10:00
Ivan Grokhotkov
9a2583122c heap/tests: make IRAM allocation size divisible by 4
heap_caps_malloc will fail to poison a block in IRAM with size not
divisible by 4. The proper fix will be to make poisoning code
smarter, or to disallow allocations from IRAM with size not aligned
by 4.
2018-07-25 09:45:39 +03:00
Ivan Grokhotkov
7a154d6a4e heap: fix unit test for the case when less than 10k of IRAM is available 2018-07-24 09:56:40 +03:00
Angus Gratton
fd88d6d89c heap: Add integer overflow checks 2018-06-19 23:31:37 +00:00
Angus Gratton
d3b8f1f927 heap tracing: Fix tracing of newlib internal allocations
Newlib internal allocations (from newlib ROM code) were not being included in the heap trace.

Ref https://github.com/espressif/esp-idf/issues/1652
2018-03-20 12:03:46 +11:00
Angus Gratton
b7fc067c8c heap: Fix bug when realloc moves data between heaps
When realloc-ing to a smaller buffer size which ends up allocated in a different heap, the heap
structure is corrupted. This can only happen:

* If heap checking is Comprehensive (meaning buffers are never shrunk in place) and the heap the buffer was originally allocated in is full.
* Calling heap_caps_realloc() to deliberately move a buffer to a different capabilities type, and shrink it at the same time.

Probable fix for https://github.com/espressif/esp-idf/issues/1582
Probably the same issue:
https://www.esp32.com/viewtopic.php?f=2&t=4583
https://www.esp32.com/viewtopic.php?f=13&t=3717
2018-02-09 16:10:52 +08:00
Angus Gratton
7a924bd85a spi_flash: Expose an accessor the current SPI flash guard functions
Change places which uses g_flash_guard_default_ops to use this. Probably exact same data, but a bit
cleaner.
2017-11-20 15:54:31 +11:00
Tian Hao
e7a9ddcf72 component/heap : fix heap_region_add check bug 2017-11-16 11:10:13 +08:00
Ivan Grokhotkov
90bbcbcdc0 unit tests: fix warnings, build with -Werror
- libsodium: silence warnings
- unit tests: fix warnings
- spiram: fix warnings
- ringbuf test: enable by default, reduce delays
2017-10-19 21:35:23 +08:00
Jeroen Domburg
740f8a79f0 Add logic to make external RAM usable with malloc() 2017-09-28 17:17:50 +08:00
Angus Gratton
1c7b8aa3a5 Heap tracing support 2017-09-07 16:32:05 +10:00
Angus Gratton
5361c08989 heap: Support adding new heap regions at runtime
To facilitate this, the list of registered heap regions is now a linked list
(allowing entries to be appended at runtime.)
2017-09-05 14:07:02 +10:00
Angus Gratton
71c70cb15c heap: Refactor heap regions/capabilities out of FreeRTOS
Remove tagged heap API, rename caps_xxx to heap_caps_xxx

Also includes additional heap_caps_xxx inspection functions.
2017-07-10 17:46:03 +08:00