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

Side by Side Diff: third_party/tcmalloc/chromium/src/malloc_hook_mmap_linux.h

Issue 24560002: Fix missing SYS_mmap when building Android on x86. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2005, Google Inc. 1 // Copyright (c) 2005, Google Inc.
2 // All rights reserved. 2 // All rights reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // * Redistributions of source code must retain the above copyright 8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer. 9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above 10 // * Redistributions in binary form must reproduce the above
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 #endif 47 #endif
48 #else 48 #else
49 #include <syscall.h> 49 #include <syscall.h>
50 #endif 50 #endif
51 #include <sys/mman.h> 51 #include <sys/mman.h>
52 #include <errno.h> 52 #include <errno.h>
53 #include "base/linux_syscall_support.h" 53 #include "base/linux_syscall_support.h"
54 54
55 // SYS_mmap2, SYS_munmap, SYS_mremap and __off64_t are not defined in Android. 55 // SYS_mmap2, SYS_munmap, SYS_mremap and __off64_t are not defined in Android.
56 #if defined(__ANDROID__) 56 #if defined(__ANDROID__)
57 #if defined(__NR_mmap) && !defined(SYS_mmap)
58 #define SYS_mmap __NR_mmap
59 #endif
57 #ifndef SYS_mmap2 60 #ifndef SYS_mmap2
58 #define SYS_mmap2 __NR_mmap2 61 #define SYS_mmap2 __NR_mmap2
59 #endif 62 #endif
60 #ifndef SYS_munmap 63 #ifndef SYS_munmap
61 #define SYS_munmap __NR_munmap 64 #define SYS_munmap __NR_munmap
62 #endif 65 #endif
63 #ifndef SYS_mremap 66 #ifndef SYS_mremap
64 #define SYS_mremap __NR_mremap 67 #define SYS_mremap __NR_mremap
65 #endif 68 #endif
66 typedef off64_t __off64_t; 69 typedef off64_t __off64_t;
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 int result; 261 int result;
259 if (!MallocHook::InvokeMunmapReplacement(start, length, &result)) { 262 if (!MallocHook::InvokeMunmapReplacement(start, length, &result)) {
260 result = syscall(SYS_munmap, start, length); 263 result = syscall(SYS_munmap, start, length);
261 } 264 }
262 return result; 265 return result;
263 } 266 }
264 267
265 #undef MALLOC_HOOK_HAVE_DO_MMAP64 268 #undef MALLOC_HOOK_HAVE_DO_MMAP64
266 269
267 #endif // #ifdef MALLOC_HOOK_HAVE_DO_MMAP64 270 #endif // #ifdef MALLOC_HOOK_HAVE_DO_MMAP64
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698