-
Notifications
You must be signed in to change notification settings - Fork 208
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
implement allocator-api via allocator-api2 crate #2192
Comments
Do you have an idea of how it might work? Currently, we only have one allocator, so being able to specify the allocator on collections like |
Wellactually :) If we implement the api for PSRAM, we can specify some types to be placed in PSRAM with this. Sometimes this might come handy, not knowing until runtime may be fine in some systems.
Yes! |
In future we might add more ways to decide from which memory we need to allocate (not sure we need it but allowed alignment, able to execute code etc. comes to my mind) I could think of a way to get an Allocator api implementation from esp-alloc matching a given |
I think this might be as simple as: pub struct PsramAllocator(&'static EspHeap);
pub static PSRAM_ALLOCATOR: PsramAllocator = PsramAllocator(&HEAP); and then We'd probably want an example that show cases this with the |
Motivations
Now that we have an allocator that supports multiple heaps we need to be able to choose where something is allocated.
Solution
We should consider using this crate to provides the api in a stable environment. I'll admit I've not looked deeply into this, but for some things being able to specify to allocate from psram (or NOT from psram) would be helpful.
Thoughts?
The text was updated successfully, but these errors were encountered: