mirror of
https://github.com/SChernykh/p2pool.git
synced 2025-04-06 14:17:26 +00:00
Fixed unaligned memory accesses
This commit is contained in:
parent
a66716c0b1
commit
55e12a3715
3 changed files with 10 additions and 2 deletions
|
@ -42,7 +42,7 @@ public:
|
|||
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; };
|
||||
|
||||
char m_consoleReadBuf[1024] = {};
|
||||
alignas(8) char m_consoleReadBuf[1024] = {};
|
||||
|
||||
std::string m_command;
|
||||
};
|
||||
|
|
|
@ -100,7 +100,7 @@ private:
|
|||
[[nodiscard]] bool on_connect() 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;
|
||||
|
||||
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);
|
||||
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();
|
||||
d->m_miner->run(d);
|
||||
|
||||
LOGINFO(1, "worker thread " << d->m_index << '/' << d->m_count << " stopped");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue