-
Notifications
You must be signed in to change notification settings - Fork 19
esp_memory_resource a PMR memory resource #24
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Code structure looks good to me. I left some minor comments. Should we add a README to the example?
esp_log_level_set("*", ESP_LOG_INFO); | ||
esp_log_level_set(idf::memory::resource::tag, ESP_LOG_VERBOSE); | ||
using enum idf::memory::capabilities; | ||
auto memory_source = dma; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: either not using auto
or the using declaration might make the type clearer when reading the code. But changing it is not a must.
return capabilities{std::to_underlying(lhs) | std::to_underlying(rhs)}; | ||
} | ||
|
||
class resource : public std::pmr::memory_resource { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For my taste, a simple comment what this class does and guiding users to the documentation of PMR would be helpful.
0da906f
to
a11c23e
Compare
66c4c4d
to
18b5623
Compare
Simple memory resource class enabling the usage of C++17 PMR facilities with IDF heap allocation capabilities.
18b5623
to
fb0b712
Compare
Simple memory resource class enabling the usage of C++17 PMR facilities with IDF heap allocation capabilities.
This enables users to set the heap memory destination for C++ containers.