Neah, probably all at once.
Interestingly, it's also possible to use unmanaged memory in C# according to this article (as afaik, using unsafe alone is still managed memory).
Printable View
Neah, probably all at once.
Interestingly, it's also possible to use unmanaged memory in C# according to this article (as afaik, using unsafe alone is still managed memory).
The use of unsafe memory like that should be restricted purely for interop cases with native code. The third reason mentioned in that link for using unmanaged arrays is completely irrelevant and should be ignored. As you're not interoping with native code, I would strongly recommend you don't try messing around with native memory as the drawbacks far outweigh the benefits.
Thanks.
Am I right in saying then that using the unsafe keyword generally in C# means the memory is still managed?
No. 'unsafe' just defines a context under which your code is executed, i.e., you can do things that you are not allowed to do under normal circumstances.