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
7f9a0ca7
Commit
7f9a0ca7
authored
Oct 24, 2016
by
Matthias Vallentin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Work around offsetof quirk on Clang/libc++/Linux
Resolves #519.
parent
9f3078e1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
libcaf_core/caf/actor_storage.hpp
libcaf_core/caf/actor_storage.hpp
+5
-0
No files found.
libcaf_core/caf/actor_storage.hpp
View file @
7f9a0ca7
...
@@ -45,12 +45,17 @@ public:
...
@@ -45,12 +45,17 @@ public:
// 1) make sure control block fits into a single cache line
// 1) make sure control block fits into a single cache line
static_assert
(
sizeof
(
actor_control_block
)
<
CAF_CACHE_LINE_SIZE
,
static_assert
(
sizeof
(
actor_control_block
)
<
CAF_CACHE_LINE_SIZE
,
"actor_control_block exceeds a single cache line"
);
"actor_control_block exceeds a single cache line"
);
// Clang in combination with libc++ on Linux complains about offsetof:
// error: 'actor_storage' does not refer to a value
// Until we have found a reliable solution, we disable this safety check.
#if !(defined(CAF_CLANG) && defined(CAF_LINUX))
// 2) make sure reinterpret cast of the control block to the storage works
// 2) make sure reinterpret cast of the control block to the storage works
static_assert
(
offsetof
(
actor_storage
,
ctrl
)
==
0
,
static_assert
(
offsetof
(
actor_storage
,
ctrl
)
==
0
,
"control block is not at the start of the storage"
);
"control block is not at the start of the storage"
);
// 3) make sure we can obtain a data pointer by jumping one cache line
// 3) make sure we can obtain a data pointer by jumping one cache line
static_assert
(
offsetof
(
actor_storage
,
data
)
==
CAF_CACHE_LINE_SIZE
,
static_assert
(
offsetof
(
actor_storage
,
data
)
==
CAF_CACHE_LINE_SIZE
,
"data is not at cache line size boundary"
);
"data is not at cache line size boundary"
);
#endif
// 4) make sure static_cast and reinterpret_cast
// 4) make sure static_cast and reinterpret_cast
// between T* and abstract_actor* are identical
// between T* and abstract_actor* are identical
/*
/*
...
...
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