-
Notifications
You must be signed in to change notification settings - Fork 2k
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
pkg: TLSF does not build for 16 bit platforms #4612
Comments
I have a dim memory that this was a constraint of TLSF to achieve O(1) runtime. |
wont be fixed for this release -> postponed. |
Is this issue still present? |
AFAIR this is an inherent problem of the TLSF implementation. One way to go around it, would be just not to offer TLSF support for 16-bit platforms and add another package for malloc on these platforms. |
Ok well let's discuss it for the next release. |
I say the same, since it is an inherent problem I don't see it necessary to mark it as a "known issue" |
hello, |
No, it's not fixed - and probably won't be fixed. For 16 bit platforms you have to use an alternative malloc() implementation. |
#9006 didn't help on this is it? I guess it wasn't tested for 16bit platforms but I'd like to know if there's a connection. |
Since the
@jcarrano didn't you find something like this? |
@OlegHahm @miri64 Take a look at UMM malloc. It seems quite nice, it's workings are documented and it has very low overhead. Also, unlike TLSF, it has no tunable parameters. It uses double linked lists, with 16bit offsets instead of pointers, because you will never be managing so much memory in a MCU. I thinks it's simplicity and low overhead could mean that we could use it to replace all usages of custom allocators (so we will still have #9434 -style bugs, but only once) Downsides: It is not O(1), but I don't think there's such a huge need for O(1), arbitrarily-sized block allocators (correct me if I'm wrong). Also, it would need some modifications in order to work with user-supplied arrays (looking at the code, it seems totally doable). On my part, I could use it for my Lua work but to make sure time is well spent I won't do anything unless there's interest from more people. |
O(1) means it is suitable for realtime code. If those are not needed, what's wrong with newlib's malloc()? |
If the rest of the code is not O(1), then it does not matter. If the allocator is O(n) and n is known beforehand and the worst case fits into the time available, it does not matter either.
I'm using TLSF because you can provide an array and do allocations there. malloc() uses a system-wide pool.
For my particular use case (Lua), I wanted to isolate the interpreter from the rest of the system as much as possible. |
How about closing this issue and open another one as a feature request for a O(1) memory allocator that supports platforms < 32 bit? |
👍 |
@OlegHahm I agree. Also, in my opinion, a O(n) allocator that works on user-supplied chunks of memory can be useful too. |
Totally agreed. I think in the best case we provide multiple pool-based memory allocators. |
Agreed. Closing this - if anyone ever finds the need for a O(1) allocator supporting <32 bits, feel free to open an issue (or better a PR). |
The text was updated successfully, but these errors were encountered: