
16 Apr
2012
16 Apr
'12
1:25 p.m.
on Mon Apr 16 2012, "Peter Dimov" <pdimov-AT-pdimov.com> wrote:
Mathias Gaunard wrote:
The code above calls the std::_Equal symbol, not memcmp. The code given for std::_Equal also does not contain a jump to any other function.
memcmp is inlined into _Equal. Replacing std::equal with memcmp yields the same assembly code, this time inlined directly at the point where == is invoked.
Don't forget alignment. Those DWORD comparisons/copies may only work well for aligned memory but when you call memcmp, you erase alignment information and the compiler may assume it's only char-aligned. -- Dave Abrahams BoostPro Computing http://www.boostpro.com