This probably means that QueryExecMgr (or one of its descendent members) is
annotated with __attribute__((aligned(64)), perhaps through something like
a CACHELINE_ALIGNED macro.
The issue is that, as the warning says, normal libc malloc doesn't make any
hard guarantees about the alignment of allocations, and the way that
'operator new' is implemented by default only gets the size and not the
desired allocation. I believe C++17 is adding support for an 'operator new'
overload that also passes the desired alignment, so that it can call down
into posix_memalign and ensure the appropriate allocation.
The "correct" fix prior to C++17 is probably to do something like overload
'operator new' for the type, or to use posix_memalign manually to allocate
aligned memory, and then placement-new it into that memory.
Another reasonable fix would probably be to add a CHECK in the constructor
that 'this' is aligned as desired so that, if you ever run on an allocator
that isn't guaranteeing what you think it is, you'll know immediately
rather than getting a surprising perf or atomicity regression due to
On Wed, Feb 14, 2018 at 12:33 PM, Sailesh Mukil <sail...@cloudera.com>
> Does anyone have experience with fixing the following type of
> clang-tidy warning?
> /home/ubuntu/Impala/be/src/runtime/exec-env.cc:159:21: warning: type
> 'impala::QueryExecMgr' requires 64 bytes of alignment and the default
> allocator only guarantees 16 bytes [clang-diagnostic-over-aligned]
> query_exec_mgr_(new QueryExecMgr()),
> /home/ubuntu/Impala/be/src/service/impalad-main.cc:80:49: warning:
> type 'impala::ImpalaServer' requires 64 bytes of alignment and the
> default allocator only guarantees 16 bytes
> boost::shared_ptr<ImpalaServer> impala_server(new
Software Engineer, Cloudera