Skip to content

Heap: Improve debug caller address reporting #8720

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 41 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
4ec3c81
Lite refactoring and expanded comments
mhightower83 Nov 11, 2022
6088147
Improve caller address reporting to indicate address in
mhightower83 Nov 18, 2022
a716193
missed items
mhightower83 Nov 21, 2022
1102256
improve comments
mhightower83 Nov 22, 2022
6dfd46a
Merge branch 'master' into pr-heap-refactor3
mhightower83 Dec 5, 2022
8b3bb1f
Merge branch 'master' into pr-heap-refactor3
mhightower83 Dec 17, 2022
ea9befa
Finish merge cleanuo
mhightower83 Dec 17, 2022
3dd08be
requested changes
mhightower83 Dec 17, 2022
45f1c3b
Added missing DRAM fallback to pvPortCallocIram, pvPortZallocIram, and
mhightower83 Dec 18, 2022
57eb2b3
Add nothrow to aliases
mhightower83 Dec 18, 2022
c2590a7
Merge branch 'master' into pr-heap-refactor3
mhightower83 Dec 19, 2022
0619034
Merge branch 'pr-heap-refactor3' of github.com:mhightower83/Arduino i…
mhightower83 Dec 19, 2022
19da675
Merge branch 'master' into pr-heap-refactor3
mhightower83 Dec 19, 2022
af7b962
Merge branch 'pr-heap-refactor3' of github.com:mhightower83/Arduino i…
mhightower83 Dec 19, 2022
9423c8e
Merge branch 'master' into pr-heap-refactor3
mhightower83 Dec 22, 2022
471f838
Merge branch 'pr-heap-refactor3' of github.com:mhightower83/Arduino i…
mhightower83 Dec 22, 2022
d829540
Merge branch 'master' into pr-heap-refactor3
mhightower83 Jan 20, 2023
4c96365
Merge branch 'pr-heap-refactor3' of github.com:mhightower83/Arduino i…
mhightower83 Jan 20, 2023
840e55a
Merge branch 'master' into pr-heap-refactor3
mhightower83 Apr 18, 2023
95c7e2c
Merge branch 'master' into pr-heap-refactor3
mhightower83 Apr 27, 2023
0ce295e
Merge branch 'master' into pr-heap-refactor3
mhightower83 Apr 28, 2023
4717dcf
Use the same format for printing caller, file, line details
mhightower83 Apr 29, 2023
b083043
refactored print_loc()
mhightower83 Apr 29, 2023
ecc1b14
Merge branch 'master' into pr-heap-refactor3
mhightower83 May 2, 2023
a0044d6
Merge branch 'master' into pr-heap-refactor3
mhightower83 Jun 16, 2023
01b238a
Merge branch 'master' into pr-heap-refactor3
mhightower83 Jul 21, 2023
b5aa1de
removed unused variable from umm_local.c
mhightower83 Jul 21, 2023
1c99daf
Merge branch 'master' into pr-heap-refactor3
mhightower83 Feb 6, 2024
2bbadca
Merge branch 'master' into pr-heap-refactor3
mhightower83 Aug 30, 2024
49b48fb
Requested changes
mhightower83 Sep 3, 2024
3786ce6
Added missing "new" operators
mhightower83 Sep 5, 2024
b9a0e55
Added missing delete array operators
mhightower83 Sep 6, 2024
a5f6d7d
malloc align build cleanup - fully builds
mhightower83 Sep 8, 2024
54b034b
Correct possition of UMM_ENABLE_MEMALIGN handling in umm_malloc/umm_m…
mhightower83 Sep 12, 2024
e948329
remove static_assert checks on alignment
mhightower83 Sep 15, 2024
5653249
Updated changes to match upstream style using uncrustify.
mhightower83 Sep 17, 2024
d303d01
update comments
mhightower83 Oct 15, 2024
01a89fd
Added test Sketch for "new" and "delete" operators
mhightower83 Oct 21, 2024
0574c1a
Oops, remove external debug libary from example.
mhightower83 Oct 22, 2024
31217f6
Improved build coverage of DEV_DEBUG_ABI_CPP option and operator dele…
mhightower83 Oct 24, 2024
ecc7eed
Changed printf format from %S => %s
mhightower83 Nov 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Requested changes
Cleanup remnants from backport
  • Loading branch information
mhightower83 committed Sep 3, 2024
commit 49b48fb5fb813e8155af6ba64d4c943e7c6c61d3
8 changes: 5 additions & 3 deletions cores/esp8266/abi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
using __cxxabiv1::__guard;

// Debugging helper, last allocation which returned NULL
extern "C" void *_heap_abi_malloc(size_t size, bool unhandled, const void* const caller);
extern "C" void* _heap_abi_malloc(size_t size, bool unhandled, const void* const caller);

extern "C" void __cxa_pure_virtual(void) __attribute__ ((__noreturn__));
extern "C" void __cxa_deleted_virtual(void) __attribute__ ((__noreturn__));
Expand All @@ -36,15 +36,16 @@ extern "C" void __cxa_deleted_virtual(void) __attribute__ ((__noreturn__));
* With the option "DEBUG_ESP_OOM," always do Last OOM tracking.
* Otherwise, disable Last OOM tracking. The build relies on the weak link to
the default C++ exception handler.
This saves about 136 bytes of IROM, code in flash.
*/

// Debug replacement adaptation from ".../new_op.cc".
using std::new_handler;
using std::bad_alloc;

void * operator new (std::size_t size)
void* operator new (std::size_t size)
{
void *p;
void* p;

/* malloc (0) is unpredictable; avoid it. */
if (__builtin_expect(size == 0, false)) {
Expand All @@ -61,6 +62,7 @@ void * operator new (std::size_t size)

return p;
}

#elif !defined(__cpp_exceptions)
// When doing builds with C++ Exceptions "disabled", always save details of
// the last OOM event.
Expand Down
2 changes: 1 addition & 1 deletion cores/esp8266/core_esp8266_postmortem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ static void postmortem_report(uint32_t sp_dump) {
ets_printf_P(PSTR("\nlast failed alloc call: 0x%08X(%d), File: %S:%d\n"),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

%s not %S?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

%S, umm_last_fail_alloc_file can be a PROGMEM string
At least some SDK file name strings are in .irom.text.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No special case in newlib here? Implementation thinks of both 's' and 'S' as exactly same
https://github.com/earlephilhower/newlib-xtensa/blob/ebc967552ce827f21fc579fd8c437037c1b472ab/newlib/libc/stdio/nano-vfprintf_i.c#L217

printf(3) says it is '%ls', which is wide-char ('wchar_t') and non-applicable here

Synonym for ls. Don't use.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have always been confused about this duality. Some print functions give an error (or is it a warning?) about %S and PROGMEM strings while other functions don't, like Serial.printf_P.

%S is used throughout core_esp_8266_postmortem.cpp for handling the printing of PROGMEM strings.

The comment for the code you pointed out reads to me that Arduino intends to have %S for PROGMEM strings.

case 'S': // TODO: Verify cap-S under Arduino is "PROGMEM char*", not wchar_t

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6280e98 / #5376
requested in #4223 (...which I would guess gets dragged down from AVR Core?)
merged in the original newlib 3.x.x code via igrr/newlib-xtensa#5

Add "%S" (capital-S) format that I've been told, but cannot verify, is used in Arduino to specify a PROGMEM string parameter in printfs, as an alias for "%s" since plain "%s" can now handle PROGMEM.

as-is both '%s' and even '%.*s' work seamlessly, no need for extra care
but it is true that it is used across the file, probably better served in a separate PR. at the very least for consistency

(uint32_t)_umm_last_fail_alloc.addr,
_umm_last_fail_alloc.size,
(_umm_last_fail_alloc.file) ? _umm_last_fail_alloc.file : "??",
(_umm_last_fail_alloc.file) ? _umm_last_fail_alloc.file : PSTR("??"),
_umm_last_fail_alloc.line);
#else
ets_printf_P(PSTR("\nlast failed alloc call: %08X(%d)\n"), (uint32_t)_umm_last_fail_alloc.addr, _umm_last_fail_alloc.size);
Expand Down
99 changes: 48 additions & 51 deletions cores/esp8266/heap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ extern "C" {
*
* Support debug wrappers that need to include handling poison
*/
#define UMM_MALLOC_FL(s,f,l,c) umm_poison_malloc(s)
#define UMM_CALLOC_FL(n,s,f,l,c) umm_poison_calloc(n,s)
#define UMM_MALLOC(s) umm_poison_malloc(s)
#define UMM_CALLOC(n,s) umm_poison_calloc(n,s)
#define UMM_REALLOC_FL(p,s,f,l,c) umm_poison_realloc_flc(p,s,f,l,c)
#define UMM_FREE_FL(p,f,l,c) umm_poison_free_flc(p,f,l,c)
#define ENABLE_THICK_DEBUG_WRAPPERS
Expand All @@ -161,19 +161,19 @@ extern "C" {
*
* Support debug wrappers that need to include handling poison
*/
#define UMM_MALLOC_FL(s,f,l,c) umm_poison_malloc(s)
#define UMM_CALLOC_FL(n,s,f,l,c) umm_poison_calloc(n,s)
#define UMM_MALLOC(s) umm_poison_malloc(s)
#define UMM_CALLOC(n,s) umm_poison_calloc(n,s)
#define UMM_REALLOC_FL(p,s,f,l,c) umm_poison_realloc(p,s)
#define UMM_FREE_FL(p,f,l,c) umm_poison_free(p)
#define ENABLE_THICK_DEBUG_WRAPPERS

#undef realloc
#undef free

#elif defined(DEBUG_ESP_OOM) || defined(UMM_INTEGRITY_CHECK) || defined(DEBUG_ESP_WITHINISR) || defined(HEAP_DEBUG_PROBE_PSFLC_CB)
#elif defined(DEBUG_ESP_OOM) || defined(UMM_INTEGRITY_CHECK) || defined(DEBUG_ESP_WITHINISR)
// All other debug wrappers that do not require handling poison
#define UMM_MALLOC_FL(s,f,l,c) umm_malloc(s)
#define UMM_CALLOC_FL(n,s,f,l,c) umm_calloc(n,s)
#define UMM_MALLOC(s) umm_malloc(s)
#define UMM_CALLOC(n,s) umm_calloc(n,s)
#define UMM_REALLOC_FL(p,s,f,l,c) umm_realloc(p,s)
#define UMM_FREE_FL(p,f,l,c) umm_free(p)
#define ENABLE_THICK_DEBUG_WRAPPERS
Expand Down Expand Up @@ -241,19 +241,19 @@ extern "C" {
// always track last failed caller and size requested
#if defined(DEBUG_ESP_OOM)
struct umm_last_fail_alloc {
const void *addr;
size_t size;
const char *file;
int line;
} _umm_last_fail_alloc = {NULL, 0, NULL, 0};
const void *addr = { nullptr };
size_t size = { 0 };
const char *file = { nullptr };
int line = { 0 };
} _umm_last_fail_alloc;

#else
// Note for the least used case "(defined(__cpp_exceptions) &&
// !defined(DEBUG_ESP_OOM))", we only capture details for LIBC calls.
struct umm_last_fail_alloc {
const void *addr;
size_t size;
} _umm_last_fail_alloc = {NULL, 0};
const void *addr = { nullptr };
size_t size = { 0 };
} _umm_last_fail_alloc;
#endif


Expand Down Expand Up @@ -314,7 +314,7 @@ static bool IRAM_ATTR oom_check__log_last_fail_atomic_psflc(void *ptr, size_t si
return true;
}
#define OOM_CHECK__LOG_LAST_FAIL_FL(p, s, f, l, c) oom_check__log_last_fail_atomic_psflc(p, s, f, l, c)
#define OOM_CHECK__LOG_LAST_FAIL_LITE_FL(p, s, f, l, c) ({ (void)p, (void)s, (void)f; (void)l; (void)c; true; })
#define OOM_CHECK__LOG_LAST_FAIL_LITE_FL(p, s, c) ({ (void)p; (void)s; (void)c; true; })

#elif defined(ENABLE_THICK_DEBUG_WRAPPERS)
static bool IRAM_ATTR oom_check__log_last_fail_atomic_psc(void *ptr, size_t size, const void* caller) {
Expand All @@ -329,7 +329,7 @@ static bool IRAM_ATTR oom_check__log_last_fail_atomic_psc(void *ptr, size_t size
return true;
}
#define OOM_CHECK__LOG_LAST_FAIL_FL(p, s, f, l, c) oom_check__log_last_fail_atomic_psc(p, s, c)
#define OOM_CHECK__LOG_LAST_FAIL_LITE_FL(p, s, f, l, c) ({ (void)p, (void)s, (void)f; (void)l; (void)c; true; })
#define OOM_CHECK__LOG_LAST_FAIL_LITE_FL(p, s, c) ({ (void)p; (void)s; (void)c; true; })

#else
// At this location, the macro is only used by Heap API families "new" and
Expand All @@ -344,8 +344,8 @@ static bool oom_check__log_last_fail_psc(void *ptr, size_t size, const void* cal
return true;
}
// Used to capture minumum OOM info for "new" and LIBC
#define OOM_CHECK__LOG_LAST_FAIL_LITE_FL(p, s, f, l, c) oom_check__log_last_fail_psc(p, s, c)
#define OOM_CHECK__LOG_LAST_FAIL_FL(p, s, f, l, c) ({ (void)p, (void)s, (void)f; (void)l; (void)c; true; })
#define OOM_CHECK__LOG_LAST_FAIL_LITE_FL(p, s, c) oom_check__log_last_fail_psc(p, s, c)
#define OOM_CHECK__LOG_LAST_FAIL_FL(p, s, c) ({ (void)p; (void)s; (void)c; true; })
#endif


Expand Down Expand Up @@ -398,26 +398,26 @@ static void isr_check__flash_not_safe(const void *caller) {
// * "fancy macros" that call heap_pvPortMalloc, ...
// * Fallback for uncapture malloc API calls, malloc, ...
//
void* IRAM_ATTR _heap_pvPortMalloc(size_t size, const char* file, int line, const void *caller)
void* IRAM_ATTR _heap_pvPortMalloc(size_t size, const char* file, int line, const void* caller)
{
INTEGRITY_CHECK__PANIC_FL(file, line, caller);
POISON_CHECK__PANIC_FL(file, line, caller);
void* ret = UMM_MALLOC_FL(size, file, line, caller);
void* ret = UMM_MALLOC(size);
OOM_CHECK__LOG_LAST_FAIL_FL(ret, size, file, line, caller);
return ret;
}

void* IRAM_ATTR _heap_pvPortCalloc(size_t count, size_t size, const char* file, int line, const void *caller)
void* IRAM_ATTR _heap_pvPortCalloc(size_t count, size_t size, const char* file, int line, const void* caller)
{
INTEGRITY_CHECK__PANIC_FL(file, line, caller);
POISON_CHECK__PANIC_FL(file, line, caller);
size_t total_size = umm_umul_sat(count, size);
void* ret = UMM_CALLOC_FL(1, total_size, file, line, caller);
void* ret = UMM_CALLOC(1, total_size);
OOM_CHECK__LOG_LAST_FAIL_FL(ret, total_size, file, line, caller);
return ret;
}

void* IRAM_ATTR _heap_pvPortRealloc(void *ptr, size_t size, const char* file, int line, const void *caller)
void* IRAM_ATTR _heap_pvPortRealloc(void* ptr, size_t size, const char* file, int line, const void* caller)
{
INTEGRITY_CHECK__PANIC_FL(file, line, caller);
POISON_CHECK__PANIC_FL(file, line, caller);
Expand All @@ -426,7 +426,7 @@ void* IRAM_ATTR _heap_pvPortRealloc(void *ptr, size_t size, const char* file, in
return ret;
}

void IRAM_ATTR _heap_vPortFree(void *ptr, const char* file, int line, [[maybe_unused]] const void *caller)
void IRAM_ATTR _heap_vPortFree(void* ptr, const char* file, int line, [[maybe_unused]] const void* caller)
{
INTEGRITY_CHECK__PANIC_FL(file, line, caller);
POISON_CHECK__PANIC_FL(file, line, caller);
Expand All @@ -448,12 +448,12 @@ void* IRAM_ATTR heap_pvPortCalloc(size_t count, size_t size, const char* file, i
return _heap_pvPortCalloc(count, size, file, line, __builtin_return_address(0));
}

void* IRAM_ATTR heap_pvPortRealloc(void *ptr, size_t size, const char* file, int line)
void* IRAM_ATTR heap_pvPortRealloc(void* ptr, size_t size, const char* file, int line)
{
return _heap_pvPortRealloc(ptr, size, file, line, __builtin_return_address(0));
}

void IRAM_ATTR heap_vPortFree(void *ptr, const char* file, int line)
void IRAM_ATTR heap_vPortFree(void* ptr, const char* file, int line)
{
return _heap_vPortFree(ptr, file, line, __builtin_return_address(0));
}
Expand Down Expand Up @@ -489,7 +489,7 @@ void IRAM_ATTR free(void* ptr)
#define STATIC_ALWAYS_INLINE static ALWAYS_INLINE

STATIC_ALWAYS_INLINE
void* IRAM_ATTR _heap_pvPortMalloc(size_t size, const char* file, int line, const void *caller)
void* IRAM_ATTR _heap_pvPortMalloc(size_t size, const char* file, int line, const void* caller)
{
(void)file;
(void)line;
Expand All @@ -498,7 +498,7 @@ void* IRAM_ATTR _heap_pvPortMalloc(size_t size, const char* file, int line, cons
}

STATIC_ALWAYS_INLINE
void* IRAM_ATTR _heap_pvPortCalloc(size_t count, size_t size, const char* file, int line, const void *caller)
void* IRAM_ATTR _heap_pvPortCalloc(size_t count, size_t size, const char* file, int line, const void* caller)
{
(void)file;
(void)line;
Expand All @@ -507,7 +507,7 @@ void* IRAM_ATTR _heap_pvPortCalloc(size_t count, size_t size, const char* file,
}

STATIC_ALWAYS_INLINE
void* IRAM_ATTR _heap_pvPortRealloc(void *ptr, size_t size, const char* file, int line, const void *caller)
void* IRAM_ATTR _heap_pvPortRealloc(void* ptr, size_t size, const char* file, int line, const void* caller)
{
(void)file;
(void)line;
Expand All @@ -516,7 +516,7 @@ void* IRAM_ATTR _heap_pvPortRealloc(void *ptr, size_t size, const char* file, in
}

STATIC_ALWAYS_INLINE
void IRAM_ATTR _heap_vPortFree(void *ptr, const char* file, int line, const void *caller)
void IRAM_ATTR _heap_vPortFree(void* ptr, const char* file, int line, const void* caller)
{
(void)file;
(void)line;
Expand All @@ -532,37 +532,37 @@ void IRAM_ATTR _heap_vPortFree(void *ptr, const char* file, int line, const void
void* _malloc_r(struct _reent* unused, size_t size)
{
(void) unused;
void *caller = __builtin_return_address(0);
void* caller = __builtin_return_address(0);
ISR_CHECK__LOG_NOT_SAFE(caller);
void* ret = _heap_pvPortMalloc(size, NULL, 0, caller);
OOM_CHECK__LOG_LAST_FAIL_LITE_FL(ret, size, NULL, 0, caller);
OOM_CHECK__LOG_LAST_FAIL_LITE_FL(ret, size, caller);
return ret;
}

void* _calloc_r(struct _reent* unused, size_t count, size_t size)
{
(void) unused;
void *caller = __builtin_return_address(0);
void* caller = __builtin_return_address(0);
ISR_CHECK__LOG_NOT_SAFE(caller);
void* ret = _heap_pvPortCalloc(count, size, NULL, 0, caller);
OOM_CHECK__LOG_LAST_FAIL_LITE_FL(ret, size, NULL, 0, caller);
OOM_CHECK__LOG_LAST_FAIL_LITE_FL(ret, size, caller);
return ret;
}

void* _realloc_r(struct _reent* unused, void* ptr, size_t size)
{
(void) unused;
void *caller = __builtin_return_address(0);
void* caller = __builtin_return_address(0);
ISR_CHECK__LOG_NOT_SAFE(caller);
void* ret = _heap_pvPortRealloc(ptr, size, NULL, 0, caller);
OOM_CHECK__LOG_LAST_FAIL_LITE_FL(ret, size, NULL, 0, caller);
OOM_CHECK__LOG_LAST_FAIL_LITE_FL(ret, size, caller);
return ret;
}

void _free_r(struct _reent* unused, void* ptr)
{
(void) unused;
void *caller = __builtin_return_address(0);
void* caller = __builtin_return_address(0);
ISR_CHECK__LOG_NOT_SAFE(caller);
_heap_vPortFree(ptr, NULL, 0, caller);
}
Expand Down Expand Up @@ -590,7 +590,7 @@ void* IRAM_ATTR pvPortCalloc(size_t count, size_t size, const char* file, int li
return _heap_pvPortCalloc(count, size, file, line, __builtin_return_address(0));
}

void* IRAM_ATTR pvPortRealloc(void *ptr, size_t size, const char* file, int line)
void* IRAM_ATTR pvPortRealloc(void* ptr, size_t size, const char* file, int line)
{
HeapSelectDram ephemeral;
return _heap_pvPortRealloc(ptr, size, file, line, __builtin_return_address(0));
Expand All @@ -602,7 +602,7 @@ void* IRAM_ATTR pvPortZalloc(size_t size, const char* file, int line)
return _heap_pvPortCalloc(1, size, file, line, __builtin_return_address(0));
}

void IRAM_ATTR vPortFree(void *ptr, const char* file, int line)
void IRAM_ATTR vPortFree(void* ptr, const char* file, int line)
{
#if defined(UMM_POISON_CHECK) || defined(UMM_INTEGRITY_CHECK)
// While umm_free internally determines the correct heap, UMM_POISON_CHECK
Expand Down Expand Up @@ -639,19 +639,16 @@ void system_show_malloc(void)
// heap allocator for "new" (ABI) - To support collecting OOM info, always defined
void* _heap_abi_malloc(size_t size, bool unhandled, const void* caller)
{
[[maybe_unused]] const char *file = NULL;
[[maybe_unused]] const int line = 0;

#ifdef ENABLE_THICK_DEBUG_WRAPPERS
ISR_CHECK__LOG_NOT_SAFE(caller);
INTEGRITY_CHECK__PANIC_FL(file, line, caller);
POISON_CHECK__PANIC_FL(file, line, caller);
void* ret = UMM_MALLOC_FL(size, file, line, caller);
bool ok = OOM_CHECK__LOG_LAST_FAIL_FL(ret, size, file, line, caller);
INTEGRITY_CHECK__PANIC_FL(NULL, 0, caller);
POISON_CHECK__PANIC_FL(NULL, 0, caller);
void* ret = UMM_MALLOC(size);
bool ok = OOM_CHECK__LOG_LAST_FAIL_FL(ret, size, NULL, 0, caller);
#else
void* ret = UMM_MALLOC(size);
// minimum OOM check
bool ok = OOM_CHECK__LOG_LAST_FAIL_LITE_FL(ret, size, file, line, caller);
bool ok = OOM_CHECK__LOG_LAST_FAIL_LITE_FL(ret, size, caller);
#endif
if (!ok && unhandled) {
__unhandled_exception(PSTR("OOM"));
Expand Down Expand Up @@ -767,22 +764,22 @@ uint32 IRAM_ATTR user_iram_memory_is_enabled(void)
//
#include <bits/c++config.h>
#include <cstdlib>
#include "new"
#include <new>

// The sized deletes are defined in other files.
#pragma GCC diagnostic ignored "-Wsized-deallocation"

// These function replace their weak counterparts tagged with _GLIBCXX_WEAK_DEFINITION
void operator delete(void* ptr) noexcept
{
void *caller = __builtin_return_address(0);
void* caller = __builtin_return_address(0);
ISR_CHECK__LOG_NOT_SAFE(caller);
_heap_vPortFree(ptr, NULL, 0, caller);
}

void operator delete(void* ptr, std::size_t) noexcept
{
void *caller = __builtin_return_address(0);
void* caller = __builtin_return_address(0);
ISR_CHECK__LOG_NOT_SAFE(caller);
_heap_vPortFree(ptr, NULL, 0, caller);
}
Expand Down
3 changes: 1 addition & 2 deletions cores/esp8266/umm_malloc/umm_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ static size_t umm_uadd_sat(const size_t a, const size_t b);


#if defined(DEBUG_ESP_OOM) || defined(UMM_POISON_CHECK) \
|| defined(UMM_POISON_CHECK_LITE) || defined(UMM_INTEGRITY_CHECK) \
|| defined(HEAP_DEBUG_PROBE_PSFLC_CB) || defined(_HEAP_DEBUG_PROBE_PSFLC_CB)
|| defined(UMM_POISON_CHECK_LITE) || defined(UMM_INTEGRITY_CHECK)
#else
#define umm_malloc(s) malloc(s)
#define umm_calloc(n,s) calloc(n,s)
Expand Down
2 changes: 1 addition & 1 deletion libraries/ESP8266SdFat
Submodule ESP8266SdFat updated 155 files
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy