Skip to content

Commit

Permalink
Add padding
Browse files Browse the repository at this point in the history
  • Loading branch information
resetius committed Nov 28, 2023
1 parent 1df557b commit 2c2b530
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/messages.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,20 @@ struct TAppendEntriesRequest: public TMessageEx {
uint64_t PrevLogTerm;
uint64_t LeaderCommit;
uint32_t LeaderId;
int32_t Nentries;
uint32_t Nentries;
};

static_assert(sizeof(TAppendEntriesRequest) == sizeof(TMessageEx) + 32);

struct TAppendEntriesResponse: public TMessageEx {
static constexpr EMessageType MessageType = EMessageType::APPEND_ENTRIES_RESPONSE;
uint64_t MatchIndex;
uint32_t Success;
uint32_t Padding = 0;
};

static_assert(sizeof(TAppendEntriesResponse) == sizeof(TMessageEx) + 16);

struct TCommandRequest: public TMessage {
static constexpr EMessageType MessageType = EMessageType::COMMAND_REQUEST;
char Data[0];
Expand Down

0 comments on commit 2c2b530

Please sign in to comment.