From a4eb9bd189d9fcb36eabd01ff2eefb137ff26ca7 Mon Sep 17 00:00:00 2001 From: Alex Liubymov Date: Fri, 13 Jan 2023 15:05:49 +0200 Subject: [PATCH] Remove stack threadlocals. --- core/src/main/scala/magnolia1/magnolia.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/scala/magnolia1/magnolia.scala b/core/src/main/scala/magnolia1/magnolia.scala index e60d1409..b0e33c07 100644 --- a/core/src/main/scala/magnolia1/magnolia.scala +++ b/core/src/main/scala/magnolia1/magnolia.scala @@ -903,8 +903,8 @@ private[magnolia1] object CompileTimeState { val depth = c.enclosingMacros.count(m => workSet(m.macroApplication.symbol)) try fn(stack.asInstanceOf[Stack[c.type]], depth) finally if (depth <= 1) { - stack.clear() - workSet.clear() + threadLocalStack.remove() + threadLocalWorkSet.remove() } } }