Skip to content

Commit 1ff8657

Browse files
authored
[scudo] Use variable instead of recomputing. (#106647)
In the get fragmentation functions, there is already a variable that computes the in use bytes, so use that instead of recomputing it.
1 parent 16900d3 commit 1ff8657

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler-rt/lib/scudo/standalone/primary32.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,7 @@ template <typename Config> class SizeClassAllocator32 {
940940

941941
uptr Integral;
942942
uptr Fractional;
943-
computePercentage(BlockSize * InUseBlocks, InUsePages * PageSize, &Integral,
943+
computePercentage(BlockSize * InUseBlocks, InUseBytes, &Integral,
944944
&Fractional);
945945
Str->append(" %02zu (%6zu): inuse/total blocks: %6zu/%6zu inuse/total "
946946
"pages: %6zu/%6zu inuse bytes: %6zuK util: %3zu.%02zu%%\n",

compiler-rt/lib/scudo/standalone/primary64.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1185,7 +1185,7 @@ template <typename Config> class SizeClassAllocator64 {
11851185

11861186
uptr Integral;
11871187
uptr Fractional;
1188-
computePercentage(BlockSize * InUseBlocks, InUsePages * PageSize, &Integral,
1188+
computePercentage(BlockSize * InUseBlocks, InUseBytes, &Integral,
11891189
&Fractional);
11901190
Str->append(" %02zu (%6zu): inuse/total blocks: %6zu/%6zu inuse/total "
11911191
"pages: %6zu/%6zu inuse bytes: %6zuK util: %3zu.%02zu%%\n",

0 commit comments

Comments
 (0)