mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-23 23:59:58 +08:00
DiskQueue: use explicitly sized int32_t instead of int in on-disk format.
It was assumed that the payloadSize field in the page header was 32 bits. This was checked by a static_assert on the size of the PageHeader struct. This change makes that field size explicit, rather than assuming that sizeof(int) == sizeof(int32_t).
This commit is contained in:
parent
e098428ebb
commit
f99277f45c
@ -1066,7 +1066,7 @@ private:
|
||||
};
|
||||
uint64_t seq; // seq is the index of the virtually infinite disk queue file. Its unit is bytes.
|
||||
uint64_t popped;
|
||||
int payloadSize;
|
||||
int32_t payloadSize;
|
||||
};
|
||||
// The on disk format depends on the size of PageHeader.
|
||||
static_assert(sizeof(PageHeader) == 36, "PageHeader must be 36 bytes");
|
||||
@ -1703,4 +1703,4 @@ TEST_CASE("performance/fdbserver/DiskQueue") {
|
||||
queue->dispose();
|
||||
wait(queue->onClosed());
|
||||
return Void();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user