java native code_原生代码(native code)
原生代碼(native code)
Native code is the code whose memory is not "managed", as in, memory isn't freed for you (C++' delete and C's free, for instance), no reference counting, no garbage collection. Managed code, you guessed it, is the code whose memory is free and allocated for you, garbage collection and other goodies.
Native code is compiled to work directly with the OS. Managed code however, is precompiled (bytecode in Java-speak) but is then processed by the Just In Time Compiler(這就是Java的JIT編譯器) to native code at runtime. Managed code has the interesting side effect of having the potential of running on different operating systems, because the machine code is not created until the VM actually uses it. This way, you are able to run .NET apps on Windows and also run them on Linux or Mac that have the Mono runtime installed. The portability is not as clean currently as Java is (because of Microsoft's naturally closed architecture), but the concept remains.
If you are running an unmanaged app, the code has been compiled to run for the designated OS/Hardware. Any portability to another OS/instruction set is lost and must be recompiled to execute.
與50位技術專家面對面20年技術見證,附贈技術全景圖總結
以上是生活随笔為你收集整理的java native code_原生代码(native code)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java is alphabetic_J
- 下一篇: java yii_构建 Java 应用程