Beta D 2.071.2-b3
Johan Engelen via Digitalmars-d-announce
digitalmars-d-announce at puremagic.com
Sun Sep 4 01:28:57 PDT 2016
On Saturday, 3 September 2016 at 18:06:37 UTC, Dicebot wrote:
> 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.
This is a very naive viewpoint.
> 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.
Exactly.
More information about the Digitalmars-d-announce
mailing list