开发者

C# do const fields use less memory?

Do const fields use less memory than regular varia开发者_StackOverflowbles?


Const fields memory consumption depends on its usage. The values of const fields are embedded into the IL code during compilation. Without a single reference to a const field there is no memory consumed. When there are many references to the const field, then memory usage may multiply depending on the code portion currently residing in memory.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜