3 ms·
Do you have any examples of projects where it's used in a "less managed" context? Are you just talking about avoiding GC, or something more advanced? Even when
by reitzensteinm 8y ago
Do you have any examples of projects where it's used in a "less managed" context? Are you just talking about avoiding GC, or something more advanced?
Even when you write in a low level style using the .Net/Mono VM, you're still fully protected by the guarantees of the language and runtime. You can't chase bad pointers around through memory or overflow the stack. It's impossible to access an array without a bounds check unless the JIT can prove it's not needed. The safety this provides is night and day to what it's like coding close to the metal (I develop games in C# and have written a fair amount of C/asm).
But as you say, we can agree to disagree about that...
- pjmlp 8y ago> You can't chase bad pointers around through memory or overflow the stack. It's impossible to access an array without a bounds check unless the JIT can prove it's not needed. Many native languages have these features without having a managed runtime.
- daeken 8y agoYou can absolutely do everything you described. You can use raw pointers in C#, to the extent that almost any C code can be converted 1:1 to C#. The memory safety goes out the window when pointers are in play; this is why we have 'unsafe' blocks.