Fixed unaligned memory accesses
This commit is contained in:
@@ -42,7 +42,7 @@ public:
|
|||||||
bool on_connect() override { return true; };
|
bool on_connect() override { return true; };
|
||||||
bool on_read(const char* data, uint32_t size) override { static_cast<ConsoleCommands*>(m_owner)->process_input(m_command, data, size); return true; };
|
bool on_read(const char* data, uint32_t size) override { static_cast<ConsoleCommands*>(m_owner)->process_input(m_command, data, size); return true; };
|
||||||
|
|
||||||
char m_consoleReadBuf[1024] = {};
|
alignas(8) char m_consoleReadBuf[1024] = {};
|
||||||
|
|
||||||
std::string m_command;
|
std::string m_command;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ private:
|
|||||||
[[nodiscard]] bool on_connect() override;
|
[[nodiscard]] bool on_connect() override;
|
||||||
[[nodiscard]] bool on_read(const char* data, uint32_t size) override;
|
[[nodiscard]] bool on_read(const char* data, uint32_t size) override;
|
||||||
|
|
||||||
char m_buf[BUF_SIZE];
|
alignas(8) char m_buf[BUF_SIZE];
|
||||||
std::vector<uint8_t> m_pendingData;
|
std::vector<uint8_t> m_pendingData;
|
||||||
|
|
||||||
bool is_paired() const { return m_pairedClient && (m_pairedClient->m_resetCounter == m_pairedClientSavedResetCounter); }
|
bool is_paired() const { return m_pairedClient && (m_pairedClient->m_resetCounter == m_pairedClientSavedResetCounter); }
|
||||||
|
|||||||
@@ -152,8 +152,16 @@ void Miner::run(void* data)
|
|||||||
{
|
{
|
||||||
WorkerData* d = static_cast<WorkerData*>(data);
|
WorkerData* d = static_cast<WorkerData*>(data);
|
||||||
LOGINFO(1, "worker thread " << d->m_index << '/' << d->m_count << " started");
|
LOGINFO(1, "worker thread " << d->m_index << '/' << d->m_count << " started");
|
||||||
|
|
||||||
|
char buf[16] = {};
|
||||||
|
log::Stream s(buf);
|
||||||
|
s << "Miner " << d->m_index << '/' << d->m_count;
|
||||||
|
|
||||||
|
set_thread_name(buf);
|
||||||
|
|
||||||
make_thread_background();
|
make_thread_background();
|
||||||
d->m_miner->run(d);
|
d->m_miner->run(d);
|
||||||
|
|
||||||
LOGINFO(1, "worker thread " << d->m_index << '/' << d->m_count << " stopped");
|
LOGINFO(1, "worker thread " << d->m_index << '/' << d->m_count << " stopped");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user