[Bug libstdc++/23425] New: vector::clear should be manually inlined

2005-08-16 Thread tkho at ucla dot edu
vector::clear calls erase(begin(), end()), which has an unnecessary call to memmove, in addition to a function call overhead. The fix results in a 2-instruction clear for simple types. Compiling the following (-O2 -save-temps) shows the difference: #include using std::vector; int main() { ve

Re: [Bug libstdc++/23425] New: vector::clear should be manually inlined

2005-08-16 Thread Andrew Pinski
> > vector::clear calls erase(begin(), end()), which has an unnecessary call to > memmove, in addition to a function call overhead. The fix results in a > 2-instruction clear for simple types. > > Compiling the following (-O2 -save-temps) shows the difference: > > #include > > using std::vecto