From 720ef7680573c1afd12f99f02eee3045daee5168 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Sat, 17 Aug 2013 14:46:54 -0700 Subject: Fix non concurrent GC ergonomics. If we dont have concurrent GC enabled, we need to force GC for alloc when we hit the maximum allowed footprint so that our heap doesn't keep growing until it hits the growth limit. Refactored a bit of stuff. Change-Id: I8eceac4ef01e969fd286ebde3a735a09d0a6dfc1 --- runtime/utils.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/utils.h') diff --git a/runtime/utils.h b/runtime/utils.h index bd8111454f..fcbb992bf4 100644 --- a/runtime/utils.h +++ b/runtime/utils.h @@ -289,12 +289,12 @@ uint64_t NanoTime(); uint64_t ThreadCpuNanoTime(); // Converts the given number of nanoseconds to milliseconds. -static inline uint64_t NsToMs(uint64_t ns) { +static constexpr inline uint64_t NsToMs(uint64_t ns) { return ns / 1000 / 1000; } // Converts the given number of milliseconds to nanoseconds -static inline uint64_t MsToNs(uint64_t ns) { +static constexpr inline uint64_t MsToNs(uint64_t ns) { return ns * 1000 * 1000; } -- cgit v1.2.3-59-g8ed1b