Movement against float.init being nan
Paulo Pinto
pjmlp at progtools.org
Sat Aug 27 21:54:18 UTC 2022
On Friday, 26 August 2022 at 20:37:40 UTC, IGotD- wrote:
> On Friday, 26 August 2022 at 18:53:33 UTC, Ali Çehreli wrote:
>>
>> Microsoft's C++ compiler used to do and probably still does
>> that. Newly allocated memory and freed memory are initialized
>> with specific patterns. (Optionally, I think with a compiler
>> switch.)
>>
>> Ali
>
> I don't think it would do that in release mode. However, in
> debug there are several things going on with the VC C++
> compiler. I haven't checked if it patterns malloc/free memory
> but it certainly patterns the stack memory and puts variables
> apart with guard patterns in between. Upon function/frame exit
> it checks all this. This is dog slow but very useful and I have
> found many bugs thanks to this. This of course will be
> unacceptable in a release build. Also initialize malloc/free
> with pattern would be undesirable in a release build.
Except Windows is actually compiled in release mode with local
variables being initialized.
https://msrc-blog.microsoft.com/2020/05/13/solving-uninitialized-stack-memory-on-windows/
And Android as well,
https://source.android.com/docs/security/memory-safety/zero-initialized-memory?hl=en
More information about the Digitalmars-d
mailing list