summaryrefslogtreecommitdiff
path: root/src/memory/allocator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/memory/allocator.cpp')
-rw-r--r--src/memory/allocator.cpp29
1 files changed, 0 insertions, 29 deletions
diff --git a/src/memory/allocator.cpp b/src/memory/allocator.cpp
deleted file mode 100644
index aaee08f8..00000000
--- a/src/memory/allocator.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright 2023 jacqueline <me@jacqueline.id.au>
- *
- * SPDX-License-Identifier: GPL-3.0-only
- */
-
-#include <cstdint>
-
-#include "esp_heap_caps.h"
-
-void* operator new[](std::size_t sz) {
- if (sz == 0) {
- ++sz; // avoid std::malloc(0) which may return nullptr on success
- }
-
- if (sz > 512) {
- return heap_caps_malloc(sz, MALLOC_CAP_SPIRAM);
- }
-
- return heap_caps_malloc(sz, MALLOC_CAP_DEFAULT);
-}
-
-void operator delete[](void* ptr) noexcept {
- heap_caps_free(ptr);
-}
-
-void operator delete[](void* ptr, std::size_t size) noexcept {
- heap_caps_free(ptr);
-}