Re:Benchmarking C++ Allocators
by steerablesafe on Tuesday April 28, 2020 @05:01AM
(#23005107)
With -fno-builtin. It's still "cheating" as b is local.
Without cheating:
It doesn't optimize the two stores to b away.
The compiler knows the semantics of malloc. Malloc as it appear in the source code doesn't even need to map 1:1 to calls to the library function, the compiler can remove and coalesce calls at will.
Interestingly, the compiler emits no call to malloc, even. What!?