Beta D 2.071.2-b3

Dicebot via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Sat Sep 3 11:06:37 PDT 2016


On Saturday, 3 September 2016 at 14:40:37 UTC, Martin Nowak wrote:
> On Wednesday, 31 August 2016 at 09:56:17 UTC, Johan Engelen 
> wrote:
>> (I can only think of complicated stuff that requires pretty 
>> much whole-program analysis to prove validity, and in that 
>> case adding `private` doesn't help any more)
>
> Yes, it does help. As private prevents usage outside of a 
> module it allows to do some optimizations that required whole 
> program analysis otherwise, e.g. variables and functions can 
> get internal linkage, thus reducing loads/stores and indirect 
> calls.

There are enough ways to leak access to private entity (alias, 
template argument, taking address, some compile-time 
introspection) to make such optimizations impossible without 
extensive program analysis.


More information about the Digitalmars-d-announce mailing list