Skip to content

Commit

Permalink
Restyled by clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
restyled-commits authored and Thirsrin committed May 1, 2024
1 parent 2d98ea1 commit 0d898d0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/platform/Linux/DiagnosticDataProviderImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetCurrentHeapUsed(uint64_t & currentHeap
currentHeapUsed = mallocInfo.uordblks;

// Update the maximum heap high watermark if the current heap usage exceeds it.
if (currentHeapUsed > maxHeapHighWatermark) {
if (currentHeapUsed > maxHeapHighWatermark)
{
maxHeapHighWatermark = currentHeapUsed;
}
return CHIP_NO_ERROR;
Expand All @@ -269,7 +270,8 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetCurrentHeapHighWatermark(uint64_t & cu
// the hard disk, called swap space, and free up that page of memory. So it is impossible
// to know accurately peak physical memory it use.
// Update the maximum heap high watermark if the current heap usage exceeds it.
if (static_cast<ssize_t>(mallocInfo.uordblks) > static_cast<ssize_t>(maxHeapHighWatermark)) {
if (static_cast<ssize_t>(mallocInfo.uordblks) > static_cast<ssize_t>(maxHeapHighWatermark))
{
maxHeapHighWatermark = mallocInfo.uordblks;
}

Expand All @@ -288,7 +290,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::ResetWatermarks()
// On Linux, the write operation is non-op since we always rely on the mallinfo system
// function to get the current heap memory.
struct mallinfo mallocInfo = mallinfo();
maxHeapHighWatermark = mallocInfo.uordblks;
maxHeapHighWatermark = mallocInfo.uordblks;

return CHIP_NO_ERROR;
}
Expand Down

0 comments on commit 0d898d0

Please sign in to comment.