Add a C++ equivalent of Android's TimingLogger, and use it for the heap.
This also changes us over to one big stats update at the end of sweeping,
like Dalvik, rather than recording every single free individually.
Change-Id: Ib8e2a83d41d36e35e154183a4e173e915af79ae9
diff --git a/src/space_test.cc b/src/space_test.cc
index ce7140f..0a6067c 100644
--- a/src/space_test.cc
+++ b/src/space_test.cc
@@ -13,23 +13,23 @@
TEST_F(SpaceTest, Init) {
{
// Less than
- UniquePtr<Space> space(Space::Create(16 * MB, 32 * MB, NULL));
+ UniquePtr<Space> space(Space::Create("test", 16 * MB, 32 * MB, NULL));
EXPECT_TRUE(space.get() != NULL);
}
{
// Equal to
- UniquePtr<Space> space(Space::Create(16 * MB, 16 * MB, NULL));
+ UniquePtr<Space> space(Space::Create("test", 16 * MB, 16 * MB, NULL));
EXPECT_TRUE(space.get() != NULL);
}
{
// Greater than
- UniquePtr<Space> space(Space::Create(32 * MB, 16 * MB, NULL));
+ UniquePtr<Space> space(Space::Create("test", 32 * MB, 16 * MB, NULL));
EXPECT_TRUE(space.get() == NULL);
}
}
TEST_F(SpaceTest, AllocAndFree) {
- UniquePtr<Space> space(Space::Create(4 * MB, 16 * MB, NULL));
+ UniquePtr<Space> space(Space::Create("test", 4 * MB, 16 * MB, NULL));
ASSERT_TRUE(space.get() != NULL);
// Succeeds, fits without adjusting the max allowed footprint.