This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Fix std::experimental::any for small, non-trivial objects
- From: Daniel Krügler <daniel dot kruegler at gmail dot com>
- To: Jonathan Wakely <jwakely at redhat dot com>
- Cc: "libstdc++" <libstdc++ at gcc dot gnu dot org>, gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 2 May 2015 19:05:38 +0200
- Subject: Re: [patch] Fix std::experimental::any for small, non-trivial objects
- Authentication-results: sourceware.org; auth=none
- References: <20150502123920 dot GW3618 at redhat dot com> <20150502130359 dot GY3618 at redhat dot com>
2015-05-02 15:03 GMT+02:00 Jonathan Wakely <jwakely@redhat.com>:
> Here's a much smaller patch for the gcc5 branch, which just avoids the
> small-object optimisation for non-trivially-copyable types. This
> pessimises some types, but is safe.
>
> (Given that this stuff is all "experimental" anyway, maybe we could
> just backport the full fix from trunk, but this is OK for now.)
>
> Tested powerpc64le-linux, committed to gcc-5-branch.
Not related to the patch, but is the second template argument of
any::_Storage::_M_buffer really correct:
std::aligned_storage<sizeof(_M_ptr), sizeof(_M_ptr)>::type _M_buffer;
I would have expected to see this to be an alignment value.
- Daniel