Files
aes67-ESP32-P4/components/spotify/patches/bell/0003-tremor-psram.patch
T
2026-10-02 19:49:42 +10:00

25 lines
809 B
Diff

diff --git a/external/tremor/os_types.h b/external/tremor/os_types.h
index 8d444d6..857f340 100644
--- a/external/tremor/os_types.h
+++ b/external/tremor/os_types.h
@@ -27,10 +27,19 @@
/* make it easy on the folks that want to compile the libs with a
different malloc than stdlib */
+#ifdef ESP_PLATFORM
+/* decoder state and codebooks in PSRAM: keeps internal RAM free */
+#include "esp_heap_caps.h"
+#define _ogg_malloc(s) heap_caps_malloc((s), MALLOC_CAP_SPIRAM)
+#define _ogg_calloc(n, s) heap_caps_calloc((n), (s), MALLOC_CAP_SPIRAM)
+#define _ogg_realloc(p, s) heap_caps_realloc((p), (s), MALLOC_CAP_SPIRAM)
+#define _ogg_free free
+#else
#define _ogg_malloc malloc
#define _ogg_calloc calloc
#define _ogg_realloc realloc
#define _ogg_free free
+#endif
#ifdef _WIN32