Merge "Adjust thresholds for pretty printing size."
diff --git a/libartbase/base/utils.cc b/libartbase/base/utils.cc
index 58d8575..b989d9e 100644
--- a/libartbase/base/utils.cc
+++ b/libartbase/base/utils.cc
@@ -96,10 +96,10 @@
// The byte thresholds at which we display amounts. A byte count is displayed
// in unit U when kUnitThresholds[U] <= bytes < kUnitThresholds[U+1].
static const int64_t kUnitThresholds[] = {
- 0, // B up to...
- 3*1024, // KB up to...
- 2*1024*1024, // MB up to...
- 1024*1024*1024 // GB from here.
+ 0, // B up to...
+ 10*KB, // KB up to...
+ 10*MB, // MB up to...
+ 10LL*GB // GB from here.
};
static const int64_t kBytesPerUnit[] = { 1, KB, MB, GB };
static const char* const kUnitStrings[] = { "B", "KB", "MB", "GB" };
diff --git a/libartbase/base/utils_test.cc b/libartbase/base/utils_test.cc
index c3b61ce..631a225 100644
--- a/libartbase/base/utils_test.cc
+++ b/libartbase/base/utils_test.cc
@@ -23,8 +23,8 @@
class UtilsTest : public testing::Test {};
TEST_F(UtilsTest, PrettySize) {
- EXPECT_EQ("1GB", PrettySize(1 * GB));
- EXPECT_EQ("2GB", PrettySize(2 * GB));
+ EXPECT_EQ("1024MB", PrettySize(1 * GB));
+ EXPECT_EQ("2048MB", PrettySize(2 * GB));
if (sizeof(size_t) > sizeof(uint32_t)) {
EXPECT_EQ("100GB", PrettySize(100 * GB));
}
diff --git a/test/202-thread-oome/src/Main.java b/test/202-thread-oome/src/Main.java
index f7df93b..b5c0ce6 100644
--- a/test/202-thread-oome/src/Main.java
+++ b/test/202-thread-oome/src/Main.java
@@ -21,7 +21,7 @@
t.start();
} catch (OutOfMemoryError expected) {
// TODO: fix bionic bug https://b/6702535 so we can check the full detail message.
- if (!expected.getMessage().startsWith("pthread_create (3GB stack) failed: ")) {
+ if (!expected.getMessage().startsWith("pthread_create (3073MB stack) failed: ")) {
throw new AssertionError(expected);
}
}