-SwappedContextFactory::SwappedContextFactory() : ContextFactory(), parallel_(SIMIX_context_is_parallel())
-{
- parmap_ = nullptr; // will be created lazily with the right parameters if needed (ie, in parallel)
- workers_context_.resize(parallel_ ? SIMIX_context_get_nthreads() : 1, nullptr);
-}
-SwappedContextFactory::~SwappedContextFactory()
-{
- delete parmap_;
-}
-
-SwappedContext::SwappedContext(std::function<void()> code, void_pfn_smxprocess_t cleanup_func, smx_actor_t process,
- SwappedContextFactory* factory)
- : Context(std::move(code), cleanup_func, process), factory_(factory)
+SwappedContext::SwappedContext(std::function<void()>&& code, smx_actor_t actor, SwappedContextFactory* factory)
+ : Context(std::move(code), actor), factory_(factory)