summaryrefslogtreecommitdiffstats
path: root/runtime/utils.h
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2013-08-17 14:46:54 -0700
committerMathieu Chartier <mathieuc@google.com>2013-08-19 09:26:23 -0700
commit720ef7680573c1afd12f99f02eee3045daee5168 (patch)
tree2c08ce225d8e6280bd0b4fa75ccf1369be3b8cc2 /runtime/utils.h
parent5bf1d38c0f0294a6632c0c6b2c0ba6bd642aa1c0 (diff)
downloadart-720ef7680573c1afd12f99f02eee3045daee5168.zip
art-720ef7680573c1afd12f99f02eee3045daee5168.tar.gz
art-720ef7680573c1afd12f99f02eee3045daee5168.tar.bz2
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
Diffstat (limited to 'runtime/utils.h')
-rw-r--r--runtime/utils.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/utils.h b/runtime/utils.h
index bd81114..fcbb992 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;
}