Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(184)

Unified Diff: third_party/tcmalloc/chromium/src/tests/system-alloc_unittest.cc

Issue 9667026: Revert 126020 - Experiment for updating the tcmalloc chromium branch to r144 (gperftools 2.0). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/tcmalloc/chromium/src/tests/system-alloc_unittest.cc
===================================================================
--- third_party/tcmalloc/chromium/src/tests/system-alloc_unittest.cc (revision 126022)
+++ third_party/tcmalloc/chromium/src/tests/system-alloc_unittest.cc (working copy)
@@ -40,9 +40,8 @@
#endif
#include <sys/types.h>
#include <algorithm>
-#include <limits>
#include "base/logging.h" // for Check_GEImpl, Check_LTImpl, etc
-#include <gperftools/malloc_extension.h> // for MallocExtension::instance
+#include <google/malloc_extension.h> // for MallocExtension::instance
#include "common.h" // for kAddressBits
class ArraySysAllocator : public SysAllocator {
@@ -84,6 +83,7 @@
void DumpStats() {
}
+ void FlagsInitialized() {}
private:
static const int kArraySize = 8 * 1024 * 1024;
@@ -115,30 +115,14 @@
const int kPointerBits = 8 * sizeof(void*);
const int kImplementedVirtualBits = NumImplementedVirtualBits();
- CHECK_GE(kAddressBits, std::min(kImplementedVirtualBits, kPointerBits));
+ CHECK_GE(kAddressBits, min(kImplementedVirtualBits, kPointerBits));
}
#endif
static void TestBasicRetryFailTest() {
// Check with the allocator still works after a failed allocation.
- //
- // There is no way to call malloc and guarantee it will fail. malloc takes a
- // size_t parameter and the C++ standard does not constrain the size of
- // size_t. For example, consider an implementation where size_t is 32 bits
- // and pointers are 64 bits.
- //
- // It is likely, though, that sizeof(size_t) == sizeof(void*). In that case,
- // the first allocation here might succeed but the second allocation must
- // fail.
- //
- // If the second allocation succeeds, you will have to rewrite or
- // disable this test.
- // The weird parens are to avoid macro-expansion of 'max' on windows.
- const size_t kHugeSize = (std::numeric_limits<size_t>::max)() / 2;
- void* p1 = malloc(kHugeSize);
- void* p2 = malloc(kHugeSize);
- CHECK(p2 == NULL);
- if (p1 != NULL) free(p1);
+ void* p = malloc(1ULL << 50); // Asking for 1P ram
+ CHECK(p == NULL);
char* q = new char[1024];
CHECK(q != NULL);

Powered by Google App Engine
This is Rietveld 408576698