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

Unified Diff: third_party/tcmalloc/chromium/src/central_freelist.h

Issue 1523403003: Lock tcmalloc structures in a pthread_atfork hook. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Hacks Created 5 years 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/central_freelist.h
diff --git a/third_party/tcmalloc/chromium/src/central_freelist.h b/third_party/tcmalloc/chromium/src/central_freelist.h
index 4fd5799de9ab53a6458942edaa056b7b56e174b5..e547f15aff0d5790b203c47e161526ed23942f3d 100644
--- a/third_party/tcmalloc/chromium/src/central_freelist.h
+++ b/third_party/tcmalloc/chromium/src/central_freelist.h
@@ -79,6 +79,16 @@ class CentralFreeList {
// page full of 5-byte objects would have 2 bytes memory overhead).
size_t OverheadBytes();
+ // Lock/Unlock the internal SpinLock. Used on the pthread_atfork call
+ // to set the lock in a consistent state before the fork.
+ void Lock() {
+ lock_.Lock();
+ }
+
+ void Unlock() {
+ lock_.Unlock();
+ }
+
private:
// TransferCache is used to cache transfers of
// sizemap.num_objects_to_move(size_class) back and forth between
« no previous file with comments | « no previous file | third_party/tcmalloc/chromium/src/libc_override_osx.h » ('j') | third_party/tcmalloc/chromium/src/static_vars.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698