From 0f9dc28e30a64f77566e0d4394ae6c32a18d84f8 Mon Sep 17 00:00:00 2001 From: gluk47 <gluk47@yandex-team.com> Date: Thu, 22 Jun 2023 19:18:03 +0300 Subject: [begemot] monlib: fix alignment for 32-bit arch / `pair<..., ui64>` is aligned by 8 bytes, whereas `TExplicitHistogramSnapshot` contains only ui32 which does not have to be 8-byte-aligned. This patch fixes a static assert from the line 203: `alignof(TExplicitHistogramSnapshot) == alignof(TBucket)` --- library/cpp/monlib/metrics/histogram_snapshot.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'library/cpp') diff --git a/library/cpp/monlib/metrics/histogram_snapshot.h b/library/cpp/monlib/metrics/histogram_snapshot.h index e8acf6ac2b..d1a32c3f94 100644 --- a/library/cpp/monlib/metrics/histogram_snapshot.h +++ b/library/cpp/monlib/metrics/histogram_snapshot.h @@ -137,7 +137,7 @@ namespace NMonitoring { // | vptr | RefsCount | BucketsCount | Bound1 | Value1 | ... | BoundN | ValueN | // +------+-----------+--------------+--------+--------+- -+--------+--------+ // - class TExplicitHistogramSnapshot: public IHistogramSnapshot, private TNonCopyable { + class alignas(TBucketValue) TExplicitHistogramSnapshot: public IHistogramSnapshot, private TNonCopyable { public: static TIntrusivePtr<TExplicitHistogramSnapshot> New(ui32 bucketsCount) { size_t bucketsSize = bucketsCount * sizeof(TBucket); -- cgit v1.2.3