mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2026-03-21 13:59:25 +00:00
applied platformio structure
This commit is contained in:
22
lib/tools/operator.cpp
Normal file
22
lib/tools/operator.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#include <memory>
|
||||
#include <esp_heap_caps.h>
|
||||
|
||||
void* operator new(std::size_t count) {
|
||||
return heap_caps_malloc(count, MALLOC_CAP_SPIRAM);
|
||||
}
|
||||
|
||||
void operator delete(void* ptr) noexcept {
|
||||
if (ptr) free(ptr);
|
||||
}
|
||||
|
||||
/*
|
||||
// C++17 only
|
||||
void* operator new (std::size_t count, std::align_val_t alignment) {
|
||||
return heap_caps_malloc(count, MALLOC_CAP_SPIRAM);
|
||||
}
|
||||
|
||||
// C++17 only
|
||||
void operator delete(void* ptr, std::align_val_t alignment) noexcept {
|
||||
if (ptr) free(ptr);
|
||||
}
|
||||
*/
|
||||
Reference in New Issue
Block a user