[PATCH] D12247: [libc++] remove possible trailing padding from aligned_storage

Yiran Wang via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 26 14:14:30 PDT 2015


yiranwang added a comment.

In http://reviews.llvm.org/D12247#233349, @EricWF wrote:

> In http://reviews.llvm.org/D12247#233323, @davidxl wrote:
>
> > We certainly need a fix without breaking ABI. Is there a ABI conformance test for libcxx?
>
>
> Well this patch definitely breaks the ABI. This was my attempt at fixing the problem in `std::function` that might not be ABI breaking..
>  https://gist.github.com/EricWF/3a35b140a66d4826a9


I think following your thought, we should abandon the usage of "aligned_storage" in "function" totally. Instead, just say "void *__buf_[3];", and check alignment_of _Fp (can be arbitrarily big, but usually small), and sizeof the two to guard use of __buf_. The alignment bump to 16 by aligned_storage on AARCH64 is not what we want, performance wise.

Also, such kind of change need to applied for some more places, at least in libc++, such like <libcxx/include/future>


http://reviews.llvm.org/D12247





More information about the cfe-commits mailing list