Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scord
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eu
ADMIRE
scord
Merge requests
!108
Resolve "Prepare 0.3.0 release"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Prepare 0.3.0 release"
147-prepare-0-3-0-release
into
main
Overview
0
Commits
4
Pipelines
2
Changes
10
Merged
Alberto Miranda
requested to merge
147-prepare-0-3-0-release
into
main
1 year ago
Overview
0
Commits
4
Pipelines
2
Changes
10
Expand
Closes
#147 (closed)
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
94b6801b
4 commits,
1 year ago
10 files
+
23
−
192
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
10
Search (e.g. *.vue) (Ctrl+P)
docker/0.2.0-wip/patches/mochi-thallium.patch deleted
100644 → 0
+
0
−
85
Options
diff --git a/include/thallium/packed_data.hpp b/include/thallium/packed_data.hpp
index 9e6e76e..37e64d3 100644
--- a/include/thallium/packed_data.hpp
+++ b/include/thallium/packed_data.hpp
@@ -14,13 +14,13 @@
namespace thallium {
-template<typename ... CtxArg> class callable_remote_procedure_with_context;
+template <typename... CtxArg> class callable_remote_procedure_with_context;
class async_response;
-template<typename ... CtxArg> class request_with_context;
+template <typename... CtxArg> class request_with_context;
using request = request_with_context<>;
namespace detail {
- struct engine_impl;
+struct engine_impl;
}
/**
@@ -36,9 +36,9 @@
class packed_data {
private:
std::weak_ptr<detail::engine_impl> m_engine_impl;
- hg_handle_t m_handle = HG_HANDLE_NULL;
- hg_return_t (*m_unpack_fn)(hg_handle_t,void*) = nullptr;
- hg_return_t (*m_free_fn)(hg_handle_t,void*) = nullptr;
+ hg_handle_t m_handle = HG_HANDLE_NULL;
+ hg_return_t (*m_unpack_fn)(hg_handle_t, void*) = nullptr;
+ hg_return_t (*m_free_fn)(hg_handle_t, void*) = nullptr;
mutable std::tuple<CtxArg...> m_context;
/**
@@ -62,6 +62,41 @@
class packed_data {
MARGO_ASSERT(ret, margo_ref_incr);
}
+ packed_data(const packed_data&) = delete;
+ packed_data& operator=(const packed_data&) = delete;
+
+ packed_data(packed_data&& rhs)
+ : m_engine_impl(std::move(rhs.m_engine_impl),
+ m_context(std::move(rhs.m_context))) {
+ m_handle = rhs.m_handle;
+ rhs.m_handle = HG_HANDLE_NULL;
+ m_unpack_fn = rhs.m_unpack_fn;
+ rhs.m_unpack_fn = nullptr;
+ m_free_fn = rhs.m_free_fn;
+ rhs.m_free_fn = nullptr;
+ }
+
+ packed_data& operator=(packed_data&& rhs) {
+
+ if(&rhs == this) {
+ return *this;
+ }
+
+ // the original members m_handle, m_context, and m_handle are being
+ // replaced here by the ones from rhs. It may be necessary to release
+ // their resources if `packed_data` has claimed ownership over them,
+ // otherwise we would be leaking
+ m_engine_impl = std::move(rhs.m_engine_impl);
+ m_context = std::move(rhs.m_context);
+
+ m_handle = rhs.m_handle;
+ rhs.m_handle = HG_HANDLE_NULL;
+ m_unpack_fn = rhs.m_unpack_fn;
+ rhs.m_unpack_fn = nullptr;
+ m_free_fn = rhs.m_free_fn;
+ rhs.m_free_fn = nullptr;
+ }
+
packed_data() = default;
public:
@@ -78,7 +113,7 @@
class packed_data {
* @tparam NewCtxArg Types of the serialization context.
* @param args Context.
*/
- template<typename ... NewCtxArg>
+ template <typename... NewCtxArg>
auto with_serialization_context(NewCtxArg&&... args) {
return packed_data<unwrap_decay_t<NewCtxArg>...>(
m_unpack_fn, m_free_fn, m_handle, m_engine_impl,
Loading