Native code and managed code)

Source: Internet
Author: User

Managed code)


Code executed by the Common Language Runtime Library environment (rather than directly by the operating system. Hosted code applications can obtain the Common Language Runtime library service, such as automatic garbage collection, Runtime Library type check, and security support. These services help provide unified managed code application behavior independent of platform and language.

Unmanaged Code-Unmanaged Code

Code that is directly executed by the operating system outside the public Language Runtime Library environment. The unmanaged code must provide its own services such as garbage collection, type check, and security support. Unlike the hosted code, the latter obtains these services from the public Language Runtime Library.

 

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

Managed code is supported. net language, such as C #, VB.net, J #, and other language compiler program code. They are not the code that the CPU can directly execute, but an intermediate code (IL ), we call it managed Code. They must be re-compiled into Native Code by the JIT compiler in CLR before they can be run, and the operation is always supported and controlled by CLR.

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

The managed code is the intermediate code that runs in the. net virtual machine. The assembly code of the Common Language
The local code is the code run by the actual CPU. on x86, It is the binary code compiled by the x86 assembly code.

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

Managed code:
In the. Net environment, the Common Language Runtime Library (CLR) provides many core runtime services, such as exception handling and security policies, garbage collection, and type conversion. The Code created with VB and C # In NET is called the managed code. All C #, VB. NET, and JScript. NET are managed by default.

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

Managed code:
Code executed by the Common Language Runtime Library environment (rather than directly by the operating system. Hosted code applications can obtain the Common Language Runtime library service, such as automatic garbage collection, Runtime Library type check, and security support. These services help provide unified managed code application behavior independent of platform and language.

Managed code supports more than 20 types of Microsoft. NET Framework, including C #, J #, Microsoft Visual Basic. NET, Microsoft JScript.. NET, and C ++. All languages share a unified set of class libraries and can be encoded as intermediate languages (IL ). Runtime-aware compiler compiles the intermediate language (IL) in the Managed execution environment to make it executable locally, and checks array boundaries and indexes to handle exceptions, garbage collection and other measures to ensure the security of the type.

Using managed code and its compilation in a managed execution environment can avoid many typical programming errors that cause security black holes and unstable programs. Similarly, many unreliable designs automatically enhance security, such as type security checks, memory management, and invalid object release. Programmers can spend more time focusing on application logic design and reduce the amount of code written. This means shorter development time and more robust programs.


From hi_dzj's column

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.