什么是托管和非托管code?code

2023-09-03 20:39:47 作者:-目罘斜視旳看著你

我发现,有人说管理code和非托管code。区别是什么?难道只为净?

I found that some say managed code and unmanaged code. What is the difference? Is it only for .Net?

推荐答案

您可以阅读维基百科的文章,的管理code 。基本管理code是一个微软的名词,但这个概念并不新鲜。请看下面的定义:

You can read this Wikipedia article, Managed code. Basically managed code is a Microsoft term, but the concept is not new. Consider the following definition:

这是安装在同一台机器的运行时引擎中执行的应用程序。该应用程序不能没有它运行。运行时环境提供程序使用的软件程序,一般图书馆和通常执行内存管理。它也可以只提供即时(JIT)从源头code转换为可执行code或从中间语言可执行code。的Java,Visual Basic和.NET的公共语言运行时(CLR)的运行时引擎的例子。

An application program that is executed within a runtime engine installed in the same machine. The application cannot run without it. The runtime environment provides the general library of software routines that the program uses and typically performs memory management. It may also provide just-in-time (JIT) conversion from source code to executable code or from an intermediate language to executable code. Java, Visual Basic and .NET's Common Language Runtime (CLR) are examples of runtime engines.

现在对比的是对这个的非托管code定义:

Now contrast that to this definition of unmanaged code:

运行本身的可执行程序。从操作系统启动时,程序呼吁,并使用软件程序在操作系统中,但并不需要另一个软件系统中使用。已组装成机器语言和C / C汇编语言程序++程序编译成机器语言的特定平台的非托管code的例子。

An executable program that runs by itself. Launched from the operating system, the program calls upon and uses the software routines in the operating system, but does not require another software system to be used. Assembly language programs that have been assembled into machine language and C/C++ programs compiled into machine language for a particular platform are examples of unmanaged code.