原生方法的源代码是否可用? [英] Is the source code of native methods available?

查看:214
本文介绍了原生方法的源代码是否可用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我想告诉您这个问题与什么是无关的。 Java中的本机实现。我从该线程中获得了许多有用的信息。

At first I want to let you know that this question is not related with What is native implementation in Java. I got many useful information from that thread.

我想知道那些原生实现的代码是否可用?我有jdk源代码,但我找不到 System.currentTimeMillis 的本机代码Runtime.getRuntime()。availableProcessors()或其他原生方法。

I want to know that are the codes of the native implementations available? I have jdk source code but I can not find the native codes for System.currentTimeMillis or Runtime.getRuntime().availableProcessors() or other native method.

推荐答案

是的,请参阅 os :: javaTimeMillis in / src / os / solaris / vm / os_solaris.cpp 以查看Solaris实现。

Yes, see os::javaTimeMillis in /src/os/solaris/vm/os_solaris.cpp to see the Solaris implementation for instance.

有几层包装器可供使用但是,请参阅 c $ c> /src/share/vm/prims/jvm.cpp中的> JVM_CurrentTimeMillis

There are a few layers of wrappers to get there though, see JVM_CurrentTimeMillis in /src/share/vm/prims/jvm.cpp

这篇关于原生方法的源代码是否可用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆