[compiler-rt] [scudo] Add utilization percentages for stats. (PR #75101)

via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 11 13:45:19 PST 2023


================
@@ -112,6 +112,21 @@ template <typename T> inline void shuffle(T *A, u32 N, u32 *RandState) {
   *RandState = State;
 }
 
+inline void computePercentage(uptr Numerator, uptr Denominator, uptr *Integral,
+                              uptr *Fractional) {
+  constexpr uptr Digits = 100;
+  if (Denominator == 0) {
----------------
ChiaHungDuan wrote:

I'm wondering if we want to assert a non-zero denominator. It seems to give the impression that 0/1 and 0/0 are the same here

https://github.com/llvm/llvm-project/pull/75101


More information about the llvm-commits mailing list