By ref and by pointer kills performance.

Bruce Carneal bcarneal at gmail.com
Wed Feb 14 13:18:25 UTC 2024


On Wednesday, 14 February 2024 at 11:46:24 UTC, Timon Gehr wrote:
> On 13.02.24 07:02, Bruce Carneal wrote:
>> 
>> To reuse the value the compiler would have to prove that the 
>> memory locations do not overlap.
>
> Not really, it only has to show that the value in the memory 
> location has not changed since the last read.

True.  I jumped to the general case where I'd seen sub optimal 
code gen.  I should have commented on both the given special, 
stationary, case and the more general.




More information about the Digitalmars-d mailing list