Commit 3fcb7b77 authored by Dominik Charousset's avatar Dominik Charousset

`vector` => `forward_list` for pending responses

The `m_pending_responses` member of `local_actor` does not need random access.
Using a `forward_list` saves us another 16 Bytes. Relates #180.
parent 7e1cf972
...@@ -438,7 +438,7 @@ class local_actor : public extend<abstract_actor>::with<mixin::memory_cached> { ...@@ -438,7 +438,7 @@ class local_actor : public extend<abstract_actor>::with<mixin::memory_cached> {
inline message_id new_request_id() { inline message_id new_request_id() {
auto result = ++m_last_request_id; auto result = ++m_last_request_id;
m_pending_responses.push_back(result.response_id()); m_pending_responses.push_front(result.response_id());
return result; return result;
} }
...@@ -495,11 +495,7 @@ class local_actor : public extend<abstract_actor>::with<mixin::memory_cached> { ...@@ -495,11 +495,7 @@ class local_actor : public extend<abstract_actor>::with<mixin::memory_cached> {
} }
inline void mark_arrived(message_id response_id) { inline void mark_arrived(message_id response_id) {
auto last = m_pending_responses.end(); m_pending_responses.remove(response_id);
auto i = std::find(m_pending_responses.begin(), last, response_id);
if (i != last) {
m_pending_responses.erase(i);
}
} }
inline uint32_t planned_exit_reason() const { inline uint32_t planned_exit_reason() const {
...@@ -526,7 +522,7 @@ class local_actor : public extend<abstract_actor>::with<mixin::memory_cached> { ...@@ -526,7 +522,7 @@ class local_actor : public extend<abstract_actor>::with<mixin::memory_cached> {
message_id m_last_request_id; message_id m_last_request_id;
// identifies all IDs of sync messages waiting for a response // identifies all IDs of sync messages waiting for a response
std::vector<message_id> m_pending_responses; std::forward_list<message_id> m_pending_responses;
// "default value" for m_current_node // "default value" for m_current_node
mailbox_element m_dummy_node; mailbox_element m_dummy_node;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment