try {
auto future = code();
future.then_([&result, self](std::shared_ptr<simgrid::kernel::FutureState<T>>&& value) {
- simgrid::xbt::set_promise(result, simgrid::kernel::Future<T>(value));
+ simgrid::xbt::set_promise(result, simgrid::kernel::Future<T>(std::move(value)));
simgrid::simix::unblock(self);
});
} catch (...) {
// When the kernel future is ready...
this->future_.then_([&result, self](std::shared_ptr<simgrid::kernel::FutureState<T>>&& value) {
// ... wake up the process with the result of the kernel future.
- simgrid::xbt::set_promise(result, simgrid::kernel::Future<T>(value));
+ simgrid::xbt::set_promise(result, simgrid::kernel::Future<T>(std::move(value)));
simgrid::simix::unblock(self);
});
} catch (...) {
// When the kernel future is ready...
this->future_.then_([this, self](std::shared_ptr<simgrid::kernel::FutureState<T>>&& value) {
// ...store it the simix kernel and wake up.
- this->future_ = std::move(simgrid::kernel::Future<T>(value));
+ this->future_ = simgrid::kernel::Future<T>(std::move(value));
simgrid::simix::unblock(self);
});
} catch (...) {
that.vtable_->move(buffer_, that.buffer_);
else
std::memcpy(static_cast<void*>(&buffer_), static_cast<void*>(&that.buffer_), sizeof(buffer_));
-
- vtable_ = that.vtable_;
+ vtable_ = std::move(that.vtable_);
that.vtable_ = nullptr;
}
Task& operator=(Task const& that) = delete;
that.vtable_->move(buffer_, that.buffer_);
else
std::memcpy(static_cast<void*>(&buffer_), static_cast<void*>(&that.buffer_), sizeof(buffer_));
- vtable_ = that.vtable_;
+ vtable_ = std::move(that.vtable_);
that.vtable_ = nullptr;
return *this;
}
string(string const& s) : string(s.c_str(), s.size()) {}
string(string&& s)
{
- str.len = s.str.len;
- str.data = s.str.data;
+ str = std::move(s.str);
s.str.len = 0;
s.str.data = &NUL;
}
static unw_addr_space_t createUnwindAddressSpace();
};
-void dumpStack(FILE* file, unw_cursor_t&& cursor);
-void dumpStack(FILE* file, pid_t pid);
+void dumpStack(FILE* file, unw_cursor_t cursor);
} // namespace mc
} // namespace simgrid
namespace simgrid {
namespace mc {
-void dumpStack(FILE* file, unw_cursor_t&& cursor)
+void dumpStack(FILE* file, unw_cursor_t cursor)
{
int nframe = 0;
char buffer[100];
return;
}
- simgrid::mc::dumpStack(stderr, std::move(cursor));
+ simgrid::mc::dumpStack(stderr, cursor);
_UPT_destroy(context);
unw_destroy_addr_space(as);