File tree 2 files changed +9
-3
lines changed
2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -417,6 +417,12 @@ config CHIP_MALLOC_SYS_HEAP_SIZE
417
417
the heap used by the memory allocation functions based on sys_heap from
418
418
Zephyr RTOS.
419
419
420
+ config CHIP_MALLOC_SYS_HEAP_WATERMARKS_SUPPORT
421
+ bool "Enable support for heap watermarks based on Zephyr sys_heap"
422
+ help
423
+ Enables support for getting current heap high watermark and resetting
424
+ watermarks.
425
+
420
426
endif
421
427
422
428
module = MATTER
Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ DiagnosticDataProviderImpl::DiagnosticDataProviderImpl() : mBootReason(Determine
123
123
124
124
bool DiagnosticDataProviderImpl::SupportsWatermarks ()
125
125
{
126
- #ifdef CONFIG_CHIP_MALLOC_SYS_HEAP
126
+ #ifdef CONFIG_CHIP_MALLOC_SYS_HEAP && CHIP_MALLOC_SYS_HEAP_WATERMARKS_SUPPORT
127
127
return true ;
128
128
#else
129
129
return false ;
@@ -165,7 +165,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetCurrentHeapUsed(uint64_t & currentHeap
165
165
166
166
CHIP_ERROR DiagnosticDataProviderImpl::GetCurrentHeapHighWatermark (uint64_t & currentHeapHighWatermark)
167
167
{
168
- #ifdef CONFIG_CHIP_MALLOC_SYS_HEAP
168
+ #ifdef CONFIG_CHIP_MALLOC_SYS_HEAP && CHIP_MALLOC_SYS_HEAP_WATERMARKS_SUPPORT
169
169
Malloc::Stats stats;
170
170
ReturnErrorOnFailure (Malloc::GetStats (stats));
171
171
@@ -178,7 +178,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetCurrentHeapHighWatermark(uint64_t & cu
178
178
179
179
CHIP_ERROR DiagnosticDataProviderImpl::ResetWatermarks ()
180
180
{
181
- #ifdef CONFIG_CHIP_MALLOC_SYS_HEAP
181
+ #ifdef CONFIG_CHIP_MALLOC_SYS_HEAP && CHIP_MALLOC_SYS_HEAP_WATERMARKS_SUPPORT
182
182
Malloc::ResetMaxStats ();
183
183
return CHIP_NO_ERROR;
184
184
#else
You can’t perform that action at this time.
0 commit comments