Skip to content

Commit 15ad513

Browse files
Memory alignment of file beginnings on 4 bytes.
1 parent 6c658dd commit 15ad513

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

cServer.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,9 @@ bool Dad::cServer::addCommonFile(const std::string& filePath, const std::string&
327327

328328
// Increment pointers
329329
m_pFirstFreeBuff += fileSize;
330+
// Align to 4 bytes
331+
m_pFirstFreeBuff = (uint8_t*)(((uintptr_t)m_pFirstFreeBuff + 3) & ~3);
332+
330333
m_pFile++;
331334

332335
file.close();

0 commit comments

Comments
 (0)