From 4fb7f8ee0762e7ae92b79f542666aadc2966fa00 Mon Sep 17 00:00:00 2001 From: Frederich Munch Date: Mon, 12 Sep 2016 05:08:07 -0400 Subject: [PATCH] Restore prior behavior always allocating a Transaction in Debug. --- lib/Interpreter/TransactionPool.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/Interpreter/TransactionPool.h b/lib/Interpreter/TransactionPool.h index cc1defc5..c2347e92 100644 --- a/lib/Interpreter/TransactionPool.h +++ b/lib/Interpreter/TransactionPool.h @@ -21,8 +21,13 @@ namespace clang { namespace cling { class TransactionPool { enum { +#ifdef NDEBUG + kDebugMode = 0, +#else + kDebugMode = 1, // Always use a new Transaction +#endif kTransactionsInBlock = 8, - kPoolSize = 2 * kTransactionsInBlock + kPoolSize = 2 * kTransactionsInBlock }; // It is twice the size of the block because there might be easily around 8 @@ -57,6 +62,9 @@ namespace cling { assert((T->getState() == Transaction::kCompleted || T->getState() == Transaction::kRolledBack) && "Transaction must completed!"); + // Force reuse to off when not in Debug mode + if (kDebugMode) + reuse = false; } // Tell the parent that T is gone.