use same heap_caps_malloc parameter as ps_malloc. (#4484)

Co-authored-by: Your Name <you@example.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
Fabian 2023-02-26 19:42:29 +01:00 committed by GitHub
parent 6ec18fc630
commit 1a9141877d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -612,7 +612,7 @@ template<class T> class ExternalRAMAllocator {
size_t size = n * sizeof(T);
T *ptr = nullptr;
#ifdef USE_ESP32
ptr = static_cast<T *>(heap_caps_malloc(size, MALLOC_CAP_SPIRAM));
ptr = static_cast<T *>(heap_caps_malloc(size, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT));
#endif
if (ptr == nullptr && (this->flags_ & Flags::REFUSE_INTERNAL) == 0)
ptr = static_cast<T *>(malloc(size)); // NOLINT(cppcoreguidelines-owning-memory,cppcoreguidelines-no-malloc)