From 36073947d2edb04e69ad0b20ec9de8c0712b8fd2 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Wed, 14 Dec 2016 14:18:22 +0000 Subject: Fix AssemblerMIPS64Test.LongBalc() running out of memory. Pre-allocate the necessary buffer because the reallocation strategy doesn't work well for a test of this size. Test: m test-art-host-gtest-assembler_mips64_test Change-Id: I16bc75f0ae83a62e5f3ed2cd8228dd40f0eb9524 --- compiler/utils/mips64/assembler_mips64_test.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/compiler/utils/mips64/assembler_mips64_test.cc b/compiler/utils/mips64/assembler_mips64_test.cc index 31d3e4c33b..f62822d73a 100644 --- a/compiler/utils/mips64/assembler_mips64_test.cc +++ b/compiler/utils/mips64/assembler_mips64_test.cc @@ -605,15 +605,18 @@ TEST_F(AssemblerMIPS64Test, Balc) { } TEST_F(AssemblerMIPS64Test, LongBalc) { + constexpr uint32_t kNopCount1 = (1u << 25) + 1; + constexpr uint32_t kNopCount2 = (1u << 25) + 1; + constexpr uint32_t kRequiredCapacity = (kNopCount1 + kNopCount2 + 6u) * 4u; + ASSERT_LT(__ GetBuffer()->Capacity(), kRequiredCapacity); + __ GetBuffer()->ExtendCapacity(kRequiredCapacity); mips64::Mips64Label label1, label2; __ Balc(&label1); - constexpr uint32_t kNopCount1 = (1u << 25) + 1; for (uint32_t i = 0; i != kNopCount1; ++i) { __ Nop(); } __ Bind(&label1); __ Balc(&label2); - constexpr uint32_t kNopCount2 = (1u << 25) + 1; for (uint32_t i = 0; i != kNopCount2; ++i) { __ Nop(); } -- cgit v1.2.3-59-g8ed1b