diff options
Diffstat (limited to 'src/protozero/test/protozero_benchmark.cc')
-rw-r--r-- | src/protozero/test/protozero_benchmark.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/protozero/test/protozero_benchmark.cc b/src/protozero/test/protozero_benchmark.cc index 52f2a6ca8..4f9fe56cf 100644 --- a/src/protozero/test/protozero_benchmark.cc +++ b/src/protozero/test/protozero_benchmark.cc @@ -68,10 +68,8 @@ struct SOLMsg { template <typename T> void Append(T x) { // The reinterpret_cast is to give favorable alignment guarantees. - // The memcpy will be elided by the compiler, which will emit just a - // 64-bit aligned mov instruction. - memcpy(reinterpret_cast<void*>(ptr_), &x, sizeof(x)); - ptr_ += sizeof(uint64_t); + memcpy(reinterpret_cast<T*>(ptr_), &x, sizeof(x)); + ptr_ += sizeof(x); } void set_field_int32(int32_t x) { Append(x); } @@ -82,7 +80,7 @@ struct SOLMsg { SOLMsg* add_field_nested() { return new (this + 1) SOLMsg(); } - alignas(uint64_t) char storage_[sizeof(g_fake_input_simple) + 8]; + char storage_[sizeof(g_fake_input_simple)]; char* ptr_ = &storage_[0]; }; |