summaryrefslogtreecommitdiff
path: root/lib/scudo
diff options
context:
space:
mode:
Diffstat (limited to 'lib/scudo')
-rw-r--r--lib/scudo/scudo_allocator.cpp4
-rw-r--r--lib/scudo/scudo_tsd.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/scudo/scudo_allocator.cpp b/lib/scudo/scudo_allocator.cpp
index 6383c6819..847a244c6 100644
--- a/lib/scudo/scudo_allocator.cpp
+++ b/lib/scudo/scudo_allocator.cpp
@@ -301,7 +301,7 @@ struct ScudoAllocator {
CheckRssLimit = HardRssLimitMb || SoftRssLimitMb;
if (CheckRssLimit)
- atomic_store_relaxed(&RssLastCheckedAtNS, NanoTime());
+ atomic_store_relaxed(&RssLastCheckedAtNS, MonotonicNanoTime());
}
// Helper function that checks for a valid Scudo chunk. nullptr isn't.
@@ -319,7 +319,7 @@ struct ScudoAllocator {
// it can, every 100ms, otherwise it will just return the current one.
bool isRssLimitExceeded() {
u64 LastCheck = atomic_load_relaxed(&RssLastCheckedAtNS);
- const u64 CurrentCheck = NanoTime();
+ const u64 CurrentCheck = MonotonicNanoTime();
if (LIKELY(CurrentCheck < LastCheck + (100ULL * 1000000ULL)))
return atomic_load_relaxed(&RssLimitExceeded);
if (!atomic_compare_exchange_weak(&RssLastCheckedAtNS, &LastCheck,
diff --git a/lib/scudo/scudo_tsd.h b/lib/scudo/scudo_tsd.h
index e8ba2cab7..80464b5ea 100644
--- a/lib/scudo/scudo_tsd.h
+++ b/lib/scudo/scudo_tsd.h
@@ -36,7 +36,7 @@ struct ALIGNED(64) ScudoTSD {
return true;
}
if (atomic_load_relaxed(&Precedence) == 0)
- atomic_store_relaxed(&Precedence, NanoTime());
+ atomic_store_relaxed(&Precedence, MonotonicNanoTime());
return false;
}