-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new message #90
new message #90
Conversation
header/actor-zeta/detail/rtt.hpp
Outdated
static const auto CAPACITY_DECREASING_THRESHOLD = std::size_t{4}; | ||
|
||
std::size_t m_capacity = 0; | ||
std::unique_ptr<std::int8_t[]> m_data; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If std::int8_t
turns out to be an alias for signed char
instead of char
(and on my system it is) there will be UB, because only char
, unsigned char
and std::byte
are exceptions to the aliasing rules. I believe that std::uint8_t
almost guaranteed to be an alias for char
or unsigned char
if you don't like to use char
explicitly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, looks like you implemented std::vector
. Maybe it's more appropriate to use it directly?
It might be awkward to implement accomodate
using std::vector
and would require unnecessary zeroing of memory, but might be worth consideration.
header/actor-zeta/detail/rtt.hpp
Outdated
std::int8_t* try_to_align(const T&) { | ||
auto space_left = capacity() - volume(); | ||
void* creation_place = data() + volume(); | ||
auto aligned_place = std::align(alignof(T), sizeof(T), creation_place, space_left); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little worried about calculating padding using two different ways: one manually in padded_size
and the other here using std::align
. But if they don't match, it's already big problem, so it's kinda okay?
…d tests for ctors
…dies and messages
…mand by cmake definition
* giving up a std::any #98 Co-authored-by: gremsnoort <grem_snoort@protonmail.com>
No description provided.