Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
37a96d85
Commit
37a96d85
authored
Dec 16, 2020
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make message_data::copy exception-safe
parent
3f59e8d4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
libcaf_core/src/detail/message_data.cpp
libcaf_core/src/detail/message_data.cpp
+2
-3
No files found.
libcaf_core/src/detail/message_data.cpp
View file @
37a96d85
...
@@ -62,18 +62,17 @@ message_data* message_data::copy() const {
...
@@ -62,18 +62,17 @@ message_data* message_data::copy() const {
auto
vptr
=
malloc
(
total_size
);
auto
vptr
=
malloc
(
total_size
);
if
(
vptr
==
nullptr
)
if
(
vptr
==
nullptr
)
CAF_RAISE_ERROR
(
std
::
bad_alloc
,
"bad_alloc"
);
CAF_RAISE_ERROR
(
std
::
bad_alloc
,
"bad_alloc"
);
auto
ptr
=
new
(
vptr
)
message_data
(
types_
)
;
intrusive_ptr
<
message_data
>
ptr
{
new
(
vptr
)
message_data
(
types_
),
false
}
;
auto
src
=
storage
();
auto
src
=
storage
();
auto
dst
=
ptr
->
storage
();
auto
dst
=
ptr
->
storage
();
for
(
auto
id
:
types_
)
{
for
(
auto
id
:
types_
)
{
auto
&
meta
=
gmos
[
id
];
auto
&
meta
=
gmos
[
id
];
// TODO: exception handling.
meta
.
copy_construct
(
dst
,
src
);
meta
.
copy_construct
(
dst
,
src
);
++
ptr
->
constructed_elements_
;
++
ptr
->
constructed_elements_
;
src
+=
meta
.
padded_size
;
src
+=
meta
.
padded_size
;
dst
+=
meta
.
padded_size
;
dst
+=
meta
.
padded_size
;
}
}
return
ptr
;
return
ptr
.
release
()
;
}
}
byte
*
message_data
::
at
(
size_t
index
)
noexcept
{
byte
*
message_data
::
at
(
size_t
index
)
noexcept
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment