gpt4 book ai didi

c# - 从代码 ⇒ IL 或 IL ⇒ native 代码创建的引用在哪里

转载 作者:行者123 更新时间:2023-12-01 12:03:44 24 4
gpt4 key购买 nike

我正在努力寻找将为对象创建引用的位置以及将在哪个阶段创建它从程序到中间代码中间代码到 native 代码.

最佳答案

This article might help :

Typically, apps that target the .NET Framework are compiled to intermediate language (IL). At run time, the just-in-time (JIT) compiler translates the IL to native code. In contrast, .NET Native compiles Windows apps directly to native code.

因此,如您所见,IL 甚至不是先决条件,它可以完全省略(尽管在大多数情况下,它不应该)

As mentioned in the CLR guide :

The runtime automatically handles object layout and manages references to objects, releasing them when they are no longer being used. Objects whose lifetimes are managed in this way are called managed data. Garbage collection eliminates memory leaks as well as some other common programming errors.

因此,由于执行的代码在运行之前被转换为 native 代码并创建了对象,所以我认为它回答了您的问题。

关于c# - 从代码 ⇒ IL 或 IL ⇒ native 代码创建的引用在哪里,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59763930/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com