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

Unified Diff: base/allocator/tcmalloc_unittest.cc

Issue 774683003: Remove tcmalloc when not being used. Restore shim on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add realloc death test. nits. Created 5 years, 11 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
« no previous file with comments | « base/allocator/prep_libc.py ('k') | base/allocator/win_allocator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/allocator/tcmalloc_unittest.cc
diff --git a/base/allocator/tcmalloc_unittest.cc b/base/allocator/tcmalloc_unittest.cc
index 053a9d50d79af271da1da392ab1a97e62a940e29..0f7082eb026052afb2b70baae821b987e0e52fab 100644
--- a/base/allocator/tcmalloc_unittest.cc
+++ b/base/allocator/tcmalloc_unittest.cc
@@ -1,17 +1,32 @@
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <stddef.h>
#include <stdio.h>
-#include "base/allocator/allocator_shim.h"
#include "testing/gtest/include/gtest/gtest.h"
-// TCMalloc header files
+// TCMalloc header files.
#include "common.h" // For TCMalloc constants like page size, etc.
-using base::allocator::TCMallocDoMallocForTest;
-using base::allocator::TCMallocDoFreeForTest;
-using base::allocator::ExcludeSpaceForMarkForTest;
+// TCMalloc implementation.
+#include "debugallocation_shim.cc"
+
+namespace {
+
+void* TCMallocDoMallocForTest(size_t size) {
+ return do_malloc(size);
+}
+
+void TCMallocDoFreeForTest(void* ptr) {
+ do_free(ptr);
+}
+
+size_t ExcludeSpaceForMarkForTest(size_t size) {
+ return ExcludeSpaceForMark(size);
+}
+
+} // namespace
TEST(TCMallocFreeCheck, BadPointerInFirstPageOfTheLargeObject) {
char* p = reinterpret_cast<char*>(
« no previous file with comments | « base/allocator/prep_libc.py ('k') | base/allocator/win_allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698