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

Unified Diff: third_party/tcmalloc/chromium/src/base/vdso_support.cc

Issue 7050034: Merge google-perftools r109 (the current contents of third_party/tcmalloc/vendor) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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/base/vdso_support.cc
===================================================================
--- third_party/tcmalloc/chromium/src/base/vdso_support.cc (revision 88335)
+++ third_party/tcmalloc/chromium/src/base/vdso_support.cc (working copy)
@@ -40,6 +40,7 @@
#ifdef HAVE_VDSO_SUPPORT // defined in vdso_support.h
#include <fcntl.h>
+#include <stddef.h> // for std::ptrdiff_t
#include "base/atomicops.h" // for MemoryBarrier
#include "base/logging.h"
@@ -207,6 +208,10 @@
if (!base) {
return;
}
+ const intptr_t base_as_uintptr_t = reinterpret_cast<uintptr_t>(base);
+ // Fake VDSO has low bit set.
+ const bool fake_vdso = ((base_as_uintptr_t & 1) != 0);
+ base = reinterpret_cast<const void *>(base_as_uintptr_t & ~1);
const char *const base_as_char = reinterpret_cast<const char *>(base);
if (base_as_char[EI_MAG0] != ELFMAG0 || base_as_char[EI_MAG1] != ELFMAG1 ||
base_as_char[EI_MAG2] != ELFMAG2 || base_as_char[EI_MAG3] != ELFMAG3) {
@@ -266,17 +271,6 @@
ElfW(Dyn) *dynamic_entry =
reinterpret_cast<ElfW(Dyn) *>(dynamic_program_header->p_vaddr +
relocation);
- bool fake_vdso = false; // Assume we are dealing with the real VDSO.
- for (ElfW(Dyn) *de = dynamic_entry; de->d_tag != DT_NULL; ++de) {
- ElfW(Sxword) tag = de->d_tag;
- if (tag == DT_PLTGOT || tag == DT_RELA || tag == DT_JMPREL ||
- tag == DT_NEEDED || tag == DT_RPATH || tag == DT_VERNEED ||
- tag == DT_INIT || tag == DT_FINI) {
- /* Real vdso can not reasonably have any of the above entries. */
- fake_vdso = true;
- break;
- }
- }
for (; dynamic_entry->d_tag != DT_NULL; ++dynamic_entry) {
ElfW(Xword) value = dynamic_entry->d_un.d_val;
if (fake_vdso) {
@@ -395,7 +389,7 @@
}
// Subtle: this code runs outside of any locks; prevent compiler
// from assigning to getcpu_fn_ more than once.
- MemoryBarrier();
+ base::subtle::MemoryBarrier();
getcpu_fn_ = fn;
return vdso_base_;
}
« no previous file with comments | « third_party/tcmalloc/chromium/src/base/vdso_support.h ('k') | third_party/tcmalloc/chromium/src/central_freelist.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698