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

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

Issue 1715903002: Adapt upstream patches fixing potential deadlock in tcmalloc after fork. Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Updated README Created 4 years, 10 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
« no previous file with comments | « third_party/tcmalloc/README.chromium ('k') | third_party/tcmalloc/chromium/src/maybe_threads.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 | « third_party/tcmalloc/README.chromium ('k') | third_party/tcmalloc/chromium/src/maybe_threads.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698