I have to compile my assembly with /unsafe in order to use a pointer. I wonder differences when I compile with /unsafe. Please assume that there is no programming faults such as invalid use of pointers etc. Do I lose some performance if I use unsafe compiled assembly? Any memory drawbacks?
Share
Well, using “unsafe” code you basically improve performance, with diect access to a memory and pointer ariphmetics . The usual case of using this is inside .NET code focused on high performance, like for example
3Drendering kernel engine. Writing stuff like this in100%.NETcode would make application too slow, so pointers come to rescue, especially when we need to deal with “bridges” betweenC/C++libriaries likeOpenGL(say)Long story short: you will benefit from it definitely, if you write a good not managed code.