summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max.kellermann@ionos.com>2024-10-04 17:22:20 +0200
committerMax Kellermann <max.kellermann@ionos.com>2024-10-09 23:15:15 +0200
commit62ebf16f71fa60fc01fb438c4316990da2239679 (patch)
treee57392718fa9c07ee17260774ed7985fdae575fd /src
parentmsg/async/ProtocolV2: eliminate redundant std::map lookups (diff)
downloadceph-62ebf16f71fa60fc01fb438c4316990da2239679.tar.xz
ceph-62ebf16f71fa60fc01fb438c4316990da2239679.zip
msg/Message: use zero-initialization instead of memset()
Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
Diffstat (limited to 'src')
-rw-r--r--src/msg/Message.h11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/msg/Message.h b/src/msg/Message.h
index 3e5c58ec376..bb67ff3eef5 100644
--- a/src/msg/Message.h
+++ b/src/msg/Message.h
@@ -262,8 +262,8 @@ public:
#endif
protected:
- ceph_msg_header header; // headerelope
- ceph_msg_footer footer;
+ ceph_msg_header header{}; // headerelope
+ ceph_msg_footer footer{};
ceph::buffer::list payload; // "front" unaligned blob
ceph::buffer::list middle; // "middle" unaligned blob
ceph::buffer::list data; // data payload (page-alignment will be preserved where possible)
@@ -332,16 +332,11 @@ protected:
friend class Messenger;
public:
- Message() {
- memset(&header, 0, sizeof(header));
- memset(&footer, 0, sizeof(footer));
- }
+ Message() = default;
Message(int t, int version=1, int compat_version=0) {
- memset(&header, 0, sizeof(header));
header.type = t;
header.version = version;
header.compat_version = compat_version;
- memset(&footer, 0, sizeof(footer));
}
Message *get() {