Skip to content

Conversation

@philippe44
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant