Replies: 1 comment 2 replies
-
Has this been approved by the roslyn compiler team? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I plan to add to the compiler an option that then when compiling it forces LAA to be set, no matter what platform they compile for (the developer would have to opt into it themselves), Also then it would remove the need to set it when
AnyCPU
+Prefer 32 Bit
is set, also fixes the lack of ability to set it forcefully from the project-system (which I filed an issue for here dotnet/project-system#6829).I am asking this because I plan to see what I can do to close and fix issue #9209.
I have located the C# one where it sets it here: https://github.com/dotnet/roslyn/blob/master/src/Compilers/Core/Portable/Compilation/Compilation.cs#L2041-L2043 I will see if I can extract it to another method and then from there have the compiler do it's job to check for the option and then set the flag only if they pass in the option (opt into it). I am sure if they pass the flag they will 100% need it set for some reason. Also doing this for even 64 bit should not be a problem at all even if it's compiled as
Any CPU
withoutPrefer 32 bit
enabled (especially when it can run and blow up on you when it runs on a 32 bit machine).The issue at hand is let the developer opt into it, they should know what is needed by what the application does and requires to work the compiler can just guess at best. Also the dotnet Sdk can also support it with this change as well too as then they can also opt into it for things like possible tools, or even other things like console programs or windows forms / wpf programs that target .NET Core. In which case having it all opt int is a major thing that needs done.
I am sorry that I do not know the compiler's implementation well (how would I when I never wrote anything on it yet) 😄.
Long story short the vast majority of .NET projects can benefit from this change to the compiler and would help reduce issues where objects are over 2 GB of RAM (on 32 bit), or 4 GB RAM (on 64 bit) because then LAA basically doubles it when it is set for both. So again I stress that the devs of any .NET project should have control over this by the project system and it can only start by changing the compiler, and the dotnet sdk first, before something can be done to add the option to 'force' LAA to be set to the property pages that would be displayed in Visual Studio itself. Heck I even think the compiler itself could benefit, even Visual Studio from the opt in to LAA being added here. This then makes what I am about to do free work for them to improve it all basically 😅. But yeah even compilers need improvements at times. The that issue I am trying to take on on the backlog on this repository stresses that many would use the very thing I will try to add and not to mention targeting AnyCPU + Prefer 32 bit is not always Acceptable when you run on a 64 bit machine and use reflection to load an c++ /clr dll that is 32 bit when all the dlls that program loads normally without reflection are all C# and target
Any CPU
without any preference making it a 64 bit process in the end. This is why I say it's unacceptable because what you then get is undefined behavior (especially when I use reflection only to load plugins via a plugin system people make over an interface they then define to use when loading it all).So yeah, where can I find the place to add the options to the compilers to then force LAA to be set when the compiler actually starts to compile?
And please also tell me what I need to apply it to the VB compiler as well too. 😃
Beta Was this translation helpful? Give feedback.
All reactions