Movement against float.init being nan

IGotD- nise at nise.com
Fri Aug 26 20:37:40 UTC 2022


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.


More information about the Digitalmars-d mailing list