From f7ecc4342b452ef12f83ec92172c144206fe7f2a Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Mon, 12 Mar 2018 15:44:55 -0700 Subject: [PATCH] ircd::ctx: Avoid any alloc for current reassertion on spawn. --- ircd/ctx.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ircd/ctx.cc b/ircd/ctx.cc index 0812e099d..4f2bdd747 100644 --- a/ircd/ctx.cc +++ b/ircd/ctx.cc @@ -569,9 +569,10 @@ ircd::ctx::context::context(const char *const &name, } // The current context must be reasserted if spawn returns here - const unwind recurrent([current(ircd::ctx::current)] + auto *const theirs(ircd::ctx::current); + const unwind recurrent([&theirs] { - ircd::ctx::current = current; + ircd::ctx::current = theirs; }); if(flags & DISPATCH)