Lines Matching refs:MB
838 static const int MB = 1048576;
839 void* a = malloc(MB);
840 void* b = malloc(MB);
841 CheckRangeCallback(a, base::MallocRange::INUSE, MB);
842 CheckRangeCallback(b, base::MallocRange::INUSE, MB);
844 CheckRangeCallback(a, base::MallocRange::FREE, MB);
845 CheckRangeCallback(b, base::MallocRange::INUSE, MB);
847 CheckRangeCallback(a, base::MallocRange::UNMAPPED, MB);
848 CheckRangeCallback(b, base::MallocRange::INUSE, MB);
850 CheckRangeCallback(a, base::MallocRange::UNMAPPED, MB);
851 CheckRangeCallback(b, base::MallocRange::FREE, MB);
871 static const int MB = 1048576;
872 void* a = malloc(MB);
873 void* b = malloc(MB);
882 MallocExtension::instance()->ReleaseToSystem(MB);
887 // The span to release should be 1MB.
888 MallocExtension::instance()->ReleaseToSystem(MB/2);
889 EXPECT_EQ(starting_bytes + MB, GetUnmappedBytes());
892 MallocExtension::instance()->ReleaseToSystem(MB/4);
893 EXPECT_EQ(starting_bytes + MB, GetUnmappedBytes());
897 // Use up the extra MB/4 bytes from 'a' and also release 'b'.
898 MallocExtension::instance()->ReleaseToSystem(MB/2);
899 EXPECT_EQ(starting_bytes + 2*MB, GetUnmappedBytes());
902 MallocExtension::instance()->ReleaseToSystem(MB/2);
903 EXPECT_EQ(starting_bytes + 2*MB, GetUnmappedBytes());
907 EXPECT_EQ(starting_bytes + 2*MB, GetUnmappedBytes());
909 a = malloc(MB);
911 EXPECT_EQ(starting_bytes + MB, GetUnmappedBytes());
915 EXPECT_EQ(starting_bytes + 2*MB, GetUnmappedBytes());