C#中的非托管代码 [英] Unmanaged Code in C#

查看:266
本文介绍了C#中的非托管代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



在CLR中直接在代码管理器的控制下运行的代码称为托管代码.因此,垃圾收集器将负责内存的重新分配,提供安全性等.

然后,如何处理非托管代码,例如如果在代码中使用关键字Unsafe来使用指针.因为所有非托管代码都是在操作系统的控制下执行的,所以内存的分配方式是相同的.

谢谢,
Prathap.

代码格式已删除[/编辑]

Hi,

The code which runs directly under the control of code manager in CLR is called managed code. So the Garbage collector will take care of memory deallocation,providing security etc.

Then what about the unmanaged code like if pointers are used using the keyword Unsafe within the code. How the memory is deallocated for the same, because all the unmanaged code is executed under the control of operating system.

Thanks,
Prathap.

Code formatting removed[/Edit]

推荐答案

请参见^ ].


这篇关于C#中的非托管代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆