Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I get free heap size? #30

Open
MoonLight423 opened this issue Oct 24, 2023 · 1 comment
Open

How can I get free heap size? #30

MoonLight423 opened this issue Oct 24, 2023 · 1 comment

Comments

@MoonLight423
Copy link

First,it,s celebratory that tlsf work well in SDRAM with STM32H750.

But how can I know the free size just like esp_get_free_heap_size();
I try to log info after malloc, but the value not change.Or I need to count that in my way?
log_d("tlsf size:%d", tlsf_size()); log_d("tlsf align size:%d", tlsf_align_size()); log_d("tlsf block size_min:%d", tlsf_block_size_min()); log_d("tlsf block size max:%d", tlsf_block_size_max());

@paniq
Copy link

paniq commented Feb 20, 2024

@MoonLight423 as documented in the header, these functions all return constants. There is no function that gives you the available memory directly. However, you can use tlsf_walk_pool to get all unused blocks, and tlsf_block_size to get the size of each unused block.

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

No branches or pull requests

2 participants