This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch] libstdc++/23425


Howard Hinnant wrote:

> Yes, _M_erase_at_end would be useful under assign, pop_back, erase, 
> and resize.  A good _M_erase_at_end will do more than simply run the 
> iterator through.  It will do the "segmented iterator" optimization 
> as  promoted by Dietmar for so many years.  That is, it will consist 
> of nested loops where the inner loop runs through a node (or partial 
> node) at a time with pointers.

FYI, I'm working on this. It looks like, we are already using the
optimization for deque::clear() and we are not for
deque::erase(iterator, iterator). It seems to me that we should just
take out the code in clear() which implements the double loop pattern
and call it from both. Which in fact would be _M_erase_at_end or
_M_erase_at_begin ;) ...

Paolo.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]