File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -668,6 +668,11 @@ void *d_calloc(size_t count, size_t size) {
668668
669669// realloc with malloc fallback, note: on ESPS8266 there is no safe way to ensure MIN_HEAP_SIZE during realloc()s, free buffer and allocate new one
670670void *d_realloc_malloc (void *ptr, size_t size) {
671+ // void *buffer = realloc(ptr, size);
672+ // buffer = validateFreeHeap(buffer);
673+ // if (buffer) return buffer; // realloc successful
674+ // d_free(ptr); // free old buffer if realloc failed (or min heap was exceeded)
675+ // return d_malloc(size); // fallback to malloc
671676 free (ptr);
672677 return d_malloc (size);
673678}
Original file line number Diff line number Diff line change @@ -171,7 +171,7 @@ void WLED::loop()
171171
172172 // reconnect WiFi to clear stale allocations if heap gets too low
173173 if (millis () - heapTime > 15000 ) {
174- uint32_t heap = getContiguousFreeHeap ();
174+ uint32_t heap = getFreeHeapSize ();
175175 if (heap < MIN_HEAP_SIZE && lastHeap < MIN_HEAP_SIZE) {
176176 DEBUG_PRINTF_P (PSTR (" Heap too low! %u\n " ), heap);
177177 forceReconnect = true ;
You can’t perform that action at this time.
0 commit comments