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

Unified Diff: third_party/tcmalloc/vendor/src/malloc_hook_mmap_linux.h

Issue 9701040: Revert 126715 - Update the tcmalloc vendor 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/vendor/src/malloc_hook_mmap_linux.h
===================================================================
--- third_party/tcmalloc/vendor/src/malloc_hook_mmap_linux.h (revision 126727)
+++ third_party/tcmalloc/vendor/src/malloc_hook_mmap_linux.h (working copy)
@@ -48,25 +48,11 @@
// The x86-32 case and the x86-64 case differ:
// 32b has a mmap2() syscall, 64b does not.
// 64b and 32b have different calling conventions for mmap().
+#if defined(__i386__) || defined(__PPC__)
-// I test for 64-bit first so I don't have to do things like
-// '#if (defined(__mips__) && !defined(__MIPS64__))' as a mips32 check.
-#if defined(__x86_64__) || defined(__PPC64__) || (defined(_MIPS_SIM) && _MIPS_SIM == _ABI64)
-
static inline void* do_mmap64(void *start, size_t length,
int prot, int flags,
int fd, __off64_t offset) __THROW {
- return sys_mmap(start, length, prot, flags, fd, offset);
-}
-
-#define MALLOC_HOOK_HAVE_DO_MMAP64 1
-
-#elif defined(__i386__) || defined(__PPC__) || defined(__mips__) || \
- defined(__arm__)
-
-static inline void* do_mmap64(void *start, size_t length,
- int prot, int flags,
- int fd, __off64_t offset) __THROW {
void *result;
// Try mmap2() unless it's not supported
@@ -99,28 +85,31 @@
goto out;
}
-#ifdef __NR_mmap
{
// Fall back to old 32-bit offset mmap() call
// Old syscall interface cannot handle six args, so pass in an array
- int32 args[6] = { (int32) start, (int32) length, prot, flags, fd,
- (off_t) offset };
+ int32 args[6] = { (int32) start, length, prot, flags, fd, (off_t) offset };
result = (void *)syscall(SYS_mmap, args);
}
-#else
- // Some Linux ports like ARM EABI Linux has no mmap, just mmap2.
- result = MAP_FAILED;
-#endif
-
out:
return result;
}
#define MALLOC_HOOK_HAVE_DO_MMAP64 1
-#endif // #if defined(__x86_64__)
+#elif defined(__x86_64__) || defined(__PPC64__) // #if defined(__i386__) || ...
+static inline void* do_mmap64(void *start, size_t length,
+ int prot, int flags,
+ int fd, __off64_t offset) __THROW {
+ return (void *)syscall(SYS_mmap, start, length, prot, flags, fd, offset);
+}
+#define MALLOC_HOOK_HAVE_DO_MMAP64 1
+
+#endif // #if defined(__i386__) || defined(__PPC__)
+
+
#ifdef MALLOC_HOOK_HAVE_DO_MMAP64
// We use do_mmap64 abstraction to put MallocHook::InvokeMmapHook
« no previous file with comments | « third_party/tcmalloc/vendor/src/malloc_hook_mmap_freebsd.h ('k') | third_party/tcmalloc/vendor/src/memfs_malloc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698