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

Unified Diff: third_party/tcmalloc/chromium/src/free_list.cc

Issue 11362046: Tweak TCMalloc freelist pointer masking (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/tcmalloc/chromium/src/free_list.cc
===================================================================
--- third_party/tcmalloc/chromium/src/free_list.cc (revision 165409)
+++ third_party/tcmalloc/chromium/src/free_list.cc (working copy)
@@ -83,11 +83,8 @@
inline void* MaskPtr(void* p) {
// Maximize ASLR entropy and guarantee the result is an invalid address.
const uintptr_t mask = ~(reinterpret_cast<uintptr_t>(TCMalloc_SystemAlloc)
- >> 13) | 1;
- // Do not mask NULL pointers, otherwise we could leak address state.
- if (p)
- return reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(p) ^ mask);
- return p;
+ >> 13);
+ return reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(p) ^ mask);
}
inline void* UnmaskPtr(void* p) {
« 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