summaryrefslogtreecommitdiff
path: root/runtime/globals.h
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/globals.h')
-rw-r--r--runtime/globals.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/runtime/globals.h b/runtime/globals.h
index 477cbdf5d4..0b44c47092 100644
--- a/runtime/globals.h
+++ b/runtime/globals.h
@@ -40,6 +40,12 @@ static constexpr size_t kStackAlignment = 16;
// compile-time constant so the compiler can generate better code.
static constexpr int kPageSize = 4096;
+// Returns whether the given memory offset can be used for generating
+// an implicit null check.
+static inline bool CanDoImplicitNullCheckOn(uintptr_t offset) {
+ return offset < kPageSize;
+}
+
// Required object alignment
static constexpr size_t kObjectAlignment = 8;
static constexpr size_t kLargeObjectAlignment = kPageSize;