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.
This PR allows heap's control block to be dynamically calculated as a function of the size of the heap.
This is useful for embedded systems like espressif/esp-idf#7829 where there are a set of disparate size memory pools that cannot be combined together using tlsf_add_pool because they must be kept separated.
In such case, the control_t block has to be the size of the one for the largest heap and that can was a lot of (precious) memory for small heap, when much larger heaps exists. When creating a heap, the size of the expected heap can be added so that pools addition using tlsf_add_pool do not overflow the initially created control_block.
I don't think there is a large CPU overhead added by making some parameter runtime instead of compile-time, but I've not yet done benchmark.