This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Relocation (= move+destroy)
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: Marc Glisse <marc dot glisse at inria dot fr>
- Cc: gcc-patches at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
- Date: Tue, 4 Sep 2018 12:19:51 +0100
- Subject: Re: Relocation (= move+destroy)
- References: <alpine.DEB.2.02.1809011549480.12789@stedding.saclay.inria.fr>
On 01/09/18 17:00 +0200, Marc Glisse wrote:
_GLIBCXX_ASAN_ANNOTATE_REINIT: I am not familiar with those
annotations. It was convenient in one function to move this annotation
after _Destroy, to reduce code duplication. For consistency, I did the
same in the whole file. As far as I understand, the macro makes it ok
to access memory between _M_finish and _M_end_of_storage, and at the
end of the block marks again the region after the new _M_finish as
protected. Since _Destroy should stop at _M_finish, moving the macro
looks safe. But maybe the position of the macro was chosen to reduce
needless checking in ASAN?
I don't remember if I had a specific reason for doing the REINIT
before _Destroy, but your change looks fine.
I'll keep reviewing the rest, but my first impression is that this is
a nice optimisation, thanks for working on it.