Skip to content

Conversation

@ChiaHungDuan
Copy link
Contributor

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Oct 3, 2024

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: None (ChiaHungDuan)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/111039.diff

1 Files Affected:

  • (modified) compiler-rt/lib/scudo/standalone/primary64.h (+3-4)
diff --git a/compiler-rt/lib/scudo/standalone/primary64.h b/compiler-rt/lib/scudo/standalone/primary64.h
index c02058219b5e13..97188a5ac235cc 100644
--- a/compiler-rt/lib/scudo/standalone/primary64.h
+++ b/compiler-rt/lib/scudo/standalone/primary64.h
@@ -1403,12 +1403,11 @@ template <typename Config> class SizeClassAllocator64 {
       if (RegionPushedBytesDelta < Region->ReleaseInfo.TryReleaseThreshold / 2)
         return false;
 
-      const u64 IntervalNs =
-          static_cast<u64>(atomic_load_relaxed(&ReleaseToOsIntervalMs)) *
-          1000000;
-      if (IntervalNs < 0)
+      const s64 IntervalMs = atomic_load_relaxed(&ReleaseToOsIntervalMs);
+      if (IntervalMs < 0)
         return false;
 
+      const u64 IntervalNs = static_cast<u64>(IntervalMs) * 1000000;
       const u64 CurTimeNs = getMonotonicTimeFast();
       const u64 DiffSinceLastReleaseNs =
           CurTimeNs - Region->ReleaseInfo.LastReleaseAtNs;

Copy link
Contributor

@cferris1000 cferris1000 left a comment

Choose a reason for hiding this comment

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

LGTM

@ChiaHungDuan ChiaHungDuan merged commit b977ec6 into llvm:main Oct 3, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants