请任何人提供有关“CLR 如何创建运行时对象” 文章?

我对“字符串文字”部分感到困惑,我找不到任何存储的理由这些作为每个对象实例的一部分,我什至无法推断出真正存储在那里的内容:
#US(用户字符串)流记录id?不,那些作为 ldstr 参数直接发送到 IL 中,并在运行时硬编码到 JITted 代码中。无需将其存储为每个实例的一部分。
运行时驻留实例?再说一次,不。首先,它们是常见的对象实例,实习表是 只是一个 GC 根,用于防止内部字符串被 GC 处理。
其次,可能存在任意数量的运行时驻留字符串,因此我们无法推断 基本实例大小
只是一张毫无意义的图片,字符串文字(无论作者暗示什么)没有存储为对象实例的一部分?不知道。
Please, can anyone provide more detail on the figure from the "How the CLR Creates Runtime Objects" article?

I'm confused with "string literals" section, I'm not able to find any reason to store those as the part of every object instance and I even could not deduct what is really stored there:
#US (user string) stream record id? No, those emitted directly into IL as a ldstr param and are hardcoded into the JITted code at runtime. There's no need to store it as a part of each instance.
Runtime-interned instances? Again, no. First, they are usual object instances and the intern table is just a GC root used to keep the interned strings from being GC'ed.
Second, there may be arbitrary number of runtime-interned strings, so we'll have no way to infer the Base Instance Size
Just a meaningless picture and the string literals (whatever the authors implied) are not stored as a part of the object instance? Don't know.
发布评论