-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
TLSF and the Temple of Corrupted Memory #3653
base: dev
Are you sure you want to change the base?
Conversation
* add tlsf as submodule * libs: tlsf * Furi: tlsf as allocator * Furi: heap walker * shmal fixshesh * f18: tlsf * PVS: ignore tlsf * I like to moving * merge upcoming changes * memmgr: alloc aligned, realloc * Furi: distinct name for auxiliary memory pool * Furi: put idle and timer thread to mem2 * Furi: fix smal things in allocator * Furi: remove aligned_free. Use free instead. * aligned_malloc -> aligned_alloc * aligned_alloc, parameters order * aligned_alloc: check that alignment is correct * unit test: malloc * unit tests: realloc and test with memory fragmentation * unit tests: aligned_alloc * update api * updater: properly read large update file Co-authored-by: Aleksandr Kutuzov <[email protected]>
Compiled f7 firmware for commit |
Regarding the 8-byte alignment, GCC indeed appears to make that assumption, with or without This code: int32_t align_test_app(void* p) {
UNUSED(p);
FURI_LOG_I("TEST", "Hello world");
FURI_LOG_I("TEST", "I'm align_test!");
void* b = malloc(4);
uintptr_t valB = (uintptr_t)b;
return (valB & 7) == 0;
} So it's a very good idea to guarantee proper alignment, at least for |
PVS-Studio report for commit |
I disabled all dolphin animations and ran some tests: tlsf
heap4
It looks like in the current version tlsf has no meaning except for the correct implementation of realloc. |
Suggestion - if this goes through, consider exposing It may be handy for cases where a nested object or class field requires alignment, but the rest of the structure does not. |
What's new
Verification
Checklist (For Reviewer)