Use SOC_DRAM_LOW/HIGH for heap-range fallback on all targets.#3061
Merged
floitsch merged 12 commits intoMay 17, 2026
Conversation
The hard-coded fallback in OS::get_heap_memory_range() is only used when cmpctmalloc doesn't populate lowest_address/highest_address (which shouldn't happen in normal Toit ESP32 builds, but acts as a safety net). Previous values were stale or wrong: - ESP32-C3 and -C6 fell through to the ESP32 #else branch with addresses (0x3FFC0000) that don't exist on those chips. - ESP32-S2 had the wrong start address, missing the low 64 KB of DRAM. - ESP32-S3 covered 384 KB starting at 0x3FCA0000, missing the lower ~96 KB of valid DRAM. - ESP32 missed the low pools (BT/ROM-shared region). Use SOC_DRAM_LOW/SOC_DRAM_HIGH from <soc/soc.h> uniformly; the GC's ONLY_FOR_MALLOC adjustment trims the low part anyway.
…-esp-idf-5.4.2.esp32p4.heap-ranges
Member
Author
|
TBR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The hard-coded fallback in OS::get_heap_memory_range() is only used when cmpctmalloc doesn't populate lowest_address/highest_address (which shouldn't happen in normal Toit ESP32 builds, but acts as a safety net).
Previous values were stale or wrong:
Use SOC_DRAM_LOW/SOC_DRAM_HIGH from <soc/soc.h> uniformly; the GC's ONLY_FOR_MALLOC adjustment trims the low part anyway.