What is Managed or Unmanaged Code?
What is Managed or Unmanaged Code?
In C#, managed code and unmanaged code refer to the way code is executed and managed by the Common Language Runtime (CLR) of the .NET Framework.
Managed code is code that runs under the control and management of the CLR. When you compile C# code, it is converted into an intermediate language (IL) code, which is then executed by the CLR. The CLR provides several benefits for managed code, such as:
Automatic memory management: The CLR's garbage collector automatically allocates and releases memory for objects, reducing the risk of memory leaks and other memory-related issues.
Type safety: The CLR enforces type safety, ensuring that objects are used in a manner consistent with their defined types.
Security: The CLR provides a security system that helps protect the system from malicious code.
Exception handling: The CLR provides a consistent exception handling mechanism, making it easier to handle and propag...
junior
Gợi ý câu hỏi phỏng vấn
Chưa có bình luận nào