Does Mono Implement CLR? Or At Least Some Unmanaged InternalCall? Or Nothing?

一个人想着一个人 提交于 2019-12-11 01:55:27

问题


We know that C# uses unmanaged code like P/Invoke or CLR implemented code like InternalCall. What I want to know is does mono it self implements a complete CLR or just some unmanaged code or nothing? I can use .Net Reflactor or ILSpy to view managed assembly, but some times due to performance issues I need to know how does CLR implement some unmanaged code. Like: How does System.String.get_lenght() do? Any one can answer questions above or some infomation about this is welcomed. Thanks.


回答1:


Yes, mono does implement the whole CLR, so if you looked at its code, you would find the implementation of methods like String.get_Length().

But Mono is a different implementation than the Microsoft CLR. What that means is if you look up the code for String.get_Length() in Mono then the Microsoft CLR could have completely different way of doing the same thing.

Another option is looking at Shared Source Common Language Infrastructure. It's from Microsoft and it's probably more similar to their implementation of CLR than Mono, but it still isn't the same. And the newest available version corresponds to .Net 2.0.



来源:https://stackoverflow.com/questions/9321803/does-mono-implement-clr-or-at-least-some-unmanaged-internalcall-or-nothing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!