From 09983d2f540fec53a59ac58cba5d86181bf7838a Mon Sep 17 00:00:00 2001
From: Jason Evans <je@fb.com>
Date: Fri, 29 May 2015 17:49:18 -0700
Subject: Bypass tcache when draining quarantined allocations.

This avoids the potential surprise of deallocating an object with one
tcache specified, and having the object cached in a different tcache
once it drains from the quarantine.
---
 src/quarantine.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/quarantine.c b/src/quarantine.c
index adc7305..6c43dfc 100644
--- a/src/quarantine.c
+++ b/src/quarantine.c
@@ -98,7 +98,7 @@ quarantine_drain_one(tsd_t *tsd, quarantine_t *quarantine)
 {
 	quarantine_obj_t *obj = &quarantine->objs[quarantine->first];
 	assert(obj->usize == isalloc(obj->ptr, config_prof));
-	idalloc(tsd, obj->ptr);
+	idalloctm(tsd, obj->ptr, NULL, false);
 	quarantine->curbytes -= obj->usize;
 	quarantine->curobjs--;
 	quarantine->first = (quarantine->first + 1) & ((ZU(1) <<
@@ -123,7 +123,7 @@ quarantine(tsd_t *tsd, void *ptr)
 	assert(opt_quarantine);
 
 	if ((quarantine = tsd_quarantine_get(tsd)) == NULL) {
-		idalloc(tsd, ptr);
+		idalloctm(tsd, ptr, NULL, false);
 		return;
 	}
 	/*
@@ -162,7 +162,7 @@ quarantine(tsd_t *tsd, void *ptr)
 		}
 	} else {
 		assert(quarantine->curbytes == 0);
-		idalloc(tsd, ptr);
+		idalloctm(tsd, ptr, NULL, false);
 	}
 }
 
-- 
cgit v0.12