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.