aboutsummaryrefslogtreecommitdiff
path: root/allocators/glibc_2.28_no_passive_falsesharing.patch
blob: fcc695c621842216152c5643b707a7491d48d6db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 27cf6137c2..3aadaddd1d 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -4172,6 +4172,9 @@ _int_free (mstate av, mchunkptr p, int have_lock)
 
 #if USE_TCACHE
   {
+    /* Check if chunk is from our own arena.  */
+    if (av == thread_arena)
+      {
     size_t tc_idx = csize2tidx (size);
     if (tcache != NULL && tc_idx < mp_.tcache_bins)
       {
@@ -4201,6 +4204,7 @@ _int_free (mstate av, mchunkptr p, int have_lock)
 	    return;
 	  }
       }
+      }
   }
 #endif