Re: Tweak vector::_M_realloc_insert for code size

2017-11-14 Thread Jonathan Wakely
On 11/11/17 19:14 +0100, Marc Glisse wrote: Hello, operator new can clobber memory, it is hard to teach the compiler otherwise since it is replaceable. Here I cache a couple values before the call to the allocator. I checked the result on this simple example: #include void f(std::vector&v)

Tweak vector::_M_realloc_insert for code size

2017-11-11 Thread Marc Glisse
Hello, operator new can clobber memory, it is hard to teach the compiler otherwise since it is replaceable. Here I cache a couple values before the call to the allocator. I checked the result on this simple example: #include void f(std::vector&v){ v.push_back(0); } The patch does not affect