heap/heap_caps: added special case for esp32s2 when handling memory allocated (and aliased) from IRAM

This commit is contained in:
Felipe Neves
2019-11-12 14:01:27 +08:00
parent ecc4955c68
commit 4a392932f1
3 changed files with 28 additions and 3 deletions

View File

@@ -31,7 +31,6 @@ TEST_CASE("realloc move data to a new heap type", "[heap]")
char *a = malloc(64);
memcpy(a, buf, 64);
// move data from 'a' to IRAM
char *b = heap_caps_realloc(a, 64, MALLOC_CAP_EXEC);
TEST_ASSERT_NOT_NULL(b);
@@ -40,7 +39,7 @@ TEST_CASE("realloc move data to a new heap type", "[heap]")
TEST_ASSERT_EQUAL_HEX32_ARRAY(buf, b, 64/sizeof(uint32_t));
// Move data back to DRAM
char *c = heap_caps_realloc(b, 48, MALLOC_CAP_8BIT);
char *c = heap_caps_realloc(b, 48, MALLOC_CAP_8BIT);
TEST_ASSERT_NOT_NULL(c);
TEST_ASSERT_NOT_EQUAL(b, c);
TEST_ASSERT(heap_caps_check_integrity(MALLOC_CAP_INVALID, true));