summaryrefslogtreecommitdiffstats
path: root/third_party
diff options
context:
space:
mode:
authorglider@chromium.org <glider@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-08 13:43:28 +0000
committerglider@chromium.org <glider@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-08 13:43:28 +0000
commitde45b80127832f4256857511d7c2de1d93c99d59 (patch)
treec9b0c064c3bea0ad9cd4deabdbfcbe631b72690a /third_party
parentdc3c97ec7e333e87ec32c11f40f3a8cbbdc4efaf (diff)
downloadchromium_src-de45b80127832f4256857511d7c2de1d93c99d59.zip
chromium_src-de45b80127832f4256857511d7c2de1d93c99d59.tar.gz
chromium_src-de45b80127832f4256857511d7c2de1d93c99d59.tar.bz2
Landing http://codereview.chromium.org/7033062/:
Replaced ptrdiff_t with std::ptrdiff_t in all files. Review URL: http://codereview.chromium.org/7046043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88328 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party')
-rw-r--r--third_party/tcmalloc/chromium/src/base/stl_allocator.h2
-rw-r--r--third_party/tcmalloc/chromium/src/base/vdso_support.cc2
-rw-r--r--third_party/tcmalloc/chromium/src/google/malloc_hook.h4
-rw-r--r--third_party/tcmalloc/chromium/src/google/malloc_hook_c.h4
-rw-r--r--third_party/tcmalloc/chromium/src/heap-checker.cc2
-rw-r--r--third_party/tcmalloc/chromium/src/heap-profiler.cc2
-rw-r--r--third_party/tcmalloc/chromium/src/malloc_hook-inl.h4
-rw-r--r--third_party/tcmalloc/chromium/src/malloc_hook.cc14
-rw-r--r--third_party/tcmalloc/chromium/src/memory_region_map.cc4
-rw-r--r--third_party/tcmalloc/chromium/src/memory_region_map.h2
-rw-r--r--third_party/tcmalloc/chromium/src/symbolize.h1
-rw-r--r--third_party/tcmalloc/chromium/src/system-alloc.cc2
-rw-r--r--third_party/tcmalloc/chromium/src/windows/port.cc2
13 files changed, 23 insertions, 22 deletions
diff --git a/third_party/tcmalloc/chromium/src/base/stl_allocator.h b/third_party/tcmalloc/chromium/src/base/stl_allocator.h
index b0ddc68..68c4860 100644
--- a/third_party/tcmalloc/chromium/src/base/stl_allocator.h
+++ b/third_party/tcmalloc/chromium/src/base/stl_allocator.h
@@ -59,7 +59,7 @@ template <typename T, class Alloc>
class STL_Allocator {
public:
typedef size_t size_type;
- typedef ptrdiff_t difference_type;
+ typedef std::ptrdiff_t difference_type;
typedef T* pointer;
typedef const T* const_pointer;
typedef T& reference;
diff --git a/third_party/tcmalloc/chromium/src/base/vdso_support.cc b/third_party/tcmalloc/chromium/src/base/vdso_support.cc
index ddaca37..d1c374c 100644
--- a/third_party/tcmalloc/chromium/src/base/vdso_support.cc
+++ b/third_party/tcmalloc/chromium/src/base/vdso_support.cc
@@ -261,7 +261,7 @@ void VDSOSupport::ElfMemImage::Init(const void *base) {
Init(0);
return;
}
- ptrdiff_t relocation =
+ std::ptrdiff_t relocation =
base_as_char - reinterpret_cast<const char *>(link_base_);
ElfW(Dyn) *dynamic_entry =
reinterpret_cast<ElfW(Dyn) *>(dynamic_program_header->p_vaddr +
diff --git a/third_party/tcmalloc/chromium/src/google/malloc_hook.h b/third_party/tcmalloc/chromium/src/google/malloc_hook.h
index 48d92da..0bc0f73 100644
--- a/third_party/tcmalloc/chromium/src/google/malloc_hook.h
+++ b/third_party/tcmalloc/chromium/src/google/malloc_hook.h
@@ -169,7 +169,7 @@ class PERFTOOLS_DLL_DECL MallocHook {
inline static PreSbrkHook SetPreSbrkHook(PreSbrkHook hook) {
return MallocHook_SetPreSbrkHook(hook);
}
- inline static void InvokePreSbrkHook(ptrdiff_t increment);
+ inline static void InvokePreSbrkHook(std::ptrdiff_t increment);
// The SbrkHook is invoked whenever sbrk is called -- except when
// the increment is 0. This is because sbrk(0) is often called
@@ -180,7 +180,7 @@ class PERFTOOLS_DLL_DECL MallocHook {
inline static SbrkHook SetSbrkHook(SbrkHook hook) {
return MallocHook_SetSbrkHook(hook);
}
- inline static void InvokeSbrkHook(const void* result, ptrdiff_t increment);
+ inline static void InvokeSbrkHook(const void* result, std::ptrdiff_t increment);
// Get the current stack trace. Try to skip all routines up to and
// and including the caller of MallocHook::Invoke*.
diff --git a/third_party/tcmalloc/chromium/src/google/malloc_hook_c.h b/third_party/tcmalloc/chromium/src/google/malloc_hook_c.h
index c870dae..0f63e0b 100644
--- a/third_party/tcmalloc/chromium/src/google/malloc_hook_c.h
+++ b/third_party/tcmalloc/chromium/src/google/malloc_hook_c.h
@@ -84,10 +84,10 @@ typedef void (*MallocHook_MremapHook)(const void* result,
const void* new_addr);
MallocHook_MremapHook MallocHook_SetMremapHook(MallocHook_MremapHook hook);
-typedef void (*MallocHook_PreSbrkHook)(ptrdiff_t increment);
+typedef void (*MallocHook_PreSbrkHook)(std::ptrdiff_t increment);
MallocHook_PreSbrkHook MallocHook_SetPreSbrkHook(MallocHook_PreSbrkHook hook);
-typedef void (*MallocHook_SbrkHook)(const void* result, ptrdiff_t increment);
+typedef void (*MallocHook_SbrkHook)(const void* result, std::ptrdiff_t increment);
MallocHook_SbrkHook MallocHook_SetSbrkHook(MallocHook_SbrkHook hook);
#endif /* _MALLOC_HOOK_C_H_ */
diff --git a/third_party/tcmalloc/chromium/src/heap-checker.cc b/third_party/tcmalloc/chromium/src/heap-checker.cc
index 84e6cf3..a04be8f 100644
--- a/third_party/tcmalloc/chromium/src/heap-checker.cc
+++ b/third_party/tcmalloc/chromium/src/heap-checker.cc
@@ -2133,7 +2133,7 @@ extern void InitialMallocHook_MMap(const void* result,
}
// Important to have this to catch the first sbrk call (say from tcmalloc):
-extern void InitialMallocHook_Sbrk(const void* result, ptrdiff_t increment) {
+extern void InitialMallocHook_Sbrk(const void* result, std::ptrdiff_t increment) {
InitHeapLeakCheckerFromMallocHook();
// record this first sbrk as well (if we need to):
MallocHook::InvokeSbrkHook(result, increment);
diff --git a/third_party/tcmalloc/chromium/src/heap-profiler.cc b/third_party/tcmalloc/chromium/src/heap-profiler.cc
index d40d4ea..4eb46e2 100644
--- a/third_party/tcmalloc/chromium/src/heap-profiler.cc
+++ b/third_party/tcmalloc/chromium/src/heap-profiler.cc
@@ -437,7 +437,7 @@ static void MunmapHook(const void* ptr, size_t size) {
}
}
-static void SbrkHook(const void* result, ptrdiff_t increment) {
+static void SbrkHook(const void* result, std::ptrdiff_t increment) {
if (FLAGS_mmap_log) { // log it
RAW_LOG(INFO, "sbrk(inc=%"PRIdS") = 0x%"PRIxPTR"",
increment, (uintptr_t) result);
diff --git a/third_party/tcmalloc/chromium/src/malloc_hook-inl.h b/third_party/tcmalloc/chromium/src/malloc_hook-inl.h
index a629691..daadf7f 100644
--- a/third_party/tcmalloc/chromium/src/malloc_hook-inl.h
+++ b/third_party/tcmalloc/chromium/src/malloc_hook-inl.h
@@ -170,7 +170,7 @@ inline MallocHook::PreSbrkHook MallocHook::GetPreSbrkHook() {
return base::internal::presbrk_hook_.Get();
}
-inline void MallocHook::InvokePreSbrkHook(ptrdiff_t increment) {
+inline void MallocHook::InvokePreSbrkHook(std::ptrdiff_t increment) {
MallocHook::PreSbrkHook hook = MallocHook::GetPreSbrkHook();
if (hook != NULL && increment != 0) (*hook)(increment);
}
@@ -180,7 +180,7 @@ inline MallocHook::SbrkHook MallocHook::GetSbrkHook() {
}
inline void MallocHook::InvokeSbrkHook(const void* result,
- ptrdiff_t increment) {
+ std::ptrdiff_t increment) {
MallocHook::SbrkHook hook = MallocHook::GetSbrkHook();
if (hook != NULL && increment != 0) (*hook)(result, increment);
}
diff --git a/third_party/tcmalloc/chromium/src/malloc_hook.cc b/third_party/tcmalloc/chromium/src/malloc_hook.cc
index 4315b86..dfb34ce 100644
--- a/third_party/tcmalloc/chromium/src/malloc_hook.cc
+++ b/third_party/tcmalloc/chromium/src/malloc_hook.cc
@@ -102,10 +102,10 @@ extern void InitialMallocHook_MMap(const void* result,
off_t offset);
ATTRIBUTE_WEAK
-extern void InitialMallocHook_PreSbrk(ptrdiff_t increment);
+extern void InitialMallocHook_PreSbrk(std::ptrdiff_t increment);
ATTRIBUTE_WEAK
-extern void InitialMallocHook_Sbrk(const void* result, ptrdiff_t increment);
+extern void InitialMallocHook_Sbrk(const void* result, std::ptrdiff_t increment);
namespace base { namespace internal {
template<typename PtrT>
@@ -240,12 +240,12 @@ void InitialMallocHook_MMap(const void* result,
MallocHook::SetMmapHook(NULL);
}
-void InitialMallocHook_PreSbrk(ptrdiff_t increment) {
+void InitialMallocHook_PreSbrk(std::ptrdiff_t increment) {
if (MallocHook::GetPreSbrkHook() == &InitialMallocHook_PreSbrk)
MallocHook::SetPreSbrkHook(NULL);
}
-void InitialMallocHook_Sbrk(const void* result, ptrdiff_t increment) {
+void InitialMallocHook_Sbrk(const void* result, std::ptrdiff_t increment) {
if (MallocHook::GetSbrkHook() == &InitialMallocHook_Sbrk)
MallocHook::SetSbrkHook(NULL);
}
@@ -449,7 +449,7 @@ extern "C" {
void* mremap(void* old_addr, size_t old_size, size_t new_size,
int flags, ...) __THROW
ATTRIBUTE_SECTION(malloc_hook);
- void* sbrk(ptrdiff_t increment) __THROW
+ void* sbrk(std::ptrdiff_t increment) __THROW
ATTRIBUTE_SECTION(malloc_hook);
}
@@ -492,9 +492,9 @@ extern "C" void* mremap(void* old_addr, size_t old_size, size_t new_size,
}
// libc's version:
-extern "C" void* __sbrk(ptrdiff_t increment);
+extern "C" void* __sbrk(std::ptrdiff_t increment);
-extern "C" void* sbrk(ptrdiff_t increment) __THROW {
+extern "C" void* sbrk(std::ptrdiff_t increment) __THROW {
MallocHook::InvokePreSbrkHook(increment);
void *result = __sbrk(increment);
MallocHook::InvokeSbrkHook(result, increment);
diff --git a/third_party/tcmalloc/chromium/src/memory_region_map.cc b/third_party/tcmalloc/chromium/src/memory_region_map.cc
index f6bed45..60071a0 100644
--- a/third_party/tcmalloc/chromium/src/memory_region_map.cc
+++ b/third_party/tcmalloc/chromium/src/memory_region_map.cc
@@ -628,9 +628,9 @@ void MemoryRegionMap::MremapHook(const void* result,
}
}
-extern "C" void* __sbrk(ptrdiff_t increment); // defined in libc
+extern "C" void* __sbrk(std::ptrdiff_t increment); // defined in libc
-void MemoryRegionMap::SbrkHook(const void* result, ptrdiff_t increment) {
+void MemoryRegionMap::SbrkHook(const void* result, std::ptrdiff_t increment) {
RAW_VLOG(10, "Sbrk = 0x%"PRIxPTR" of %"PRIdS"", (uintptr_t)result, increment);
if (result != reinterpret_cast<void*>(-1)) {
if (increment > 0) {
diff --git a/third_party/tcmalloc/chromium/src/memory_region_map.h b/third_party/tcmalloc/chromium/src/memory_region_map.h
index f88c7b9..6b38b25 100644
--- a/third_party/tcmalloc/chromium/src/memory_region_map.h
+++ b/third_party/tcmalloc/chromium/src/memory_region_map.h
@@ -323,7 +323,7 @@ class MemoryRegionMap {
static void MremapHook(const void* result, const void* old_addr,
size_t old_size, size_t new_size, int flags,
const void* new_addr);
- static void SbrkHook(const void* result, ptrdiff_t increment);
+ static void SbrkHook(const void* result, std::ptrdiff_t increment);
// Log all memory regions; Useful for debugging only.
// Assumes Lock() is held
diff --git a/third_party/tcmalloc/chromium/src/symbolize.h b/third_party/tcmalloc/chromium/src/symbolize.h
index 1ab4ed6..e80cc49 100644
--- a/third_party/tcmalloc/chromium/src/symbolize.h
+++ b/third_party/tcmalloc/chromium/src/symbolize.h
@@ -35,6 +35,7 @@
#include "config.h"
#ifdef HAVE_STDINT_H
+#include <stddef.h>
#include <stdint.h> // for uintptr_t
#endif
#include <map>
diff --git a/third_party/tcmalloc/chromium/src/system-alloc.cc b/third_party/tcmalloc/chromium/src/system-alloc.cc
index 29bed80..0f41ac2 100644
--- a/third_party/tcmalloc/chromium/src/system-alloc.cc
+++ b/third_party/tcmalloc/chromium/src/system-alloc.cc
@@ -166,7 +166,7 @@ void* SbrkSysAllocator::Alloc(size_t size, size_t *actual_size,
// sbrk will release memory if passed a negative number, so we do
// a strict check here
- if (static_cast<ptrdiff_t>(size + alignment) < 0) return NULL;
+ if (static_cast<std::ptrdiff_t>(size + alignment) < 0) return NULL;
// This doesn't overflow because TCMalloc_SystemAlloc has already
// tested for overflow at the alignment boundary.
diff --git a/third_party/tcmalloc/chromium/src/windows/port.cc b/third_party/tcmalloc/chromium/src/windows/port.cc
index eaa93b7..59b0417 100644
--- a/third_party/tcmalloc/chromium/src/windows/port.cc
+++ b/third_party/tcmalloc/chromium/src/windows/port.cc
@@ -77,7 +77,7 @@ int getpagesize() {
return pagesize;
}
-extern "C" PERFTOOLS_DLL_DECL void* __sbrk(ptrdiff_t increment) {
+extern "C" PERFTOOLS_DLL_DECL void* __sbrk(std::ptrdiff_t increment) {
LOG(FATAL, "Windows doesn't implement sbrk!\n");
return NULL;
}