MB-20054: Account for memory alloc/dealloc in unregisterBucket 25/65525/8
authorDave Rigby <daver@couchbase.com>
Tue, 5 Jul 2016 20:34:56 +0000 (21:34 +0100)
committerDave Rigby <daver@couchbase.com>
Thu, 7 Jul 2016 15:59:40 +0000 (15:59 +0000)
While unregistering a bucket, any memory allocations/deallocations
made should be accounted to the bucket in question.  Hence no
`onSwitchThread(NULL)` call.

Change-Id: I5c260e3aa7e2c8d1fd4ff0a1ca20f2185a7362a8
Reviewed-on: http://review.couchbase.org/65525
Well-Formed: buildbot <build@couchbase.com>
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Will Gardner <will.gardner@couchbase.com>
Reviewed-by: Jim Walker <jim@couchbase.com>
src/executorpool.cc

index 401c52e..dd4aef6 100644 (file)
@@ -606,9 +606,10 @@ void ExecutorPool::_unregisterBucket(EventuallyPersistentEngine *engine) {
 }
 
 void ExecutorPool::unregisterBucket(EventuallyPersistentEngine *engine) {
 }
 
 void ExecutorPool::unregisterBucket(EventuallyPersistentEngine *engine) {
-    EventuallyPersistentEngine *epe = ObjectRegistry::onSwitchThread(NULL, true);
+    // Note: unregistering a bucket is special - any memory allocations /
+    // deallocations made while unregistering *should* be accounted to the
+    // bucket in question - hence no `onSwitchThread(NULL)` call.
     _unregisterBucket(engine);
     _unregisterBucket(engine);
-    ObjectRegistry::onSwitchThread(epe);
 }
 
 void ExecutorPool::doTaskQStat(EventuallyPersistentEngine *engine,
 }
 
 void ExecutorPool::doTaskQStat(EventuallyPersistentEngine *engine,