mirror of
https://github.com/corda/corda.git
synced 2025-01-09 06:23:04 +00:00
run JNI_OnLoad if found in ClassLoader.loadLibrary
This commit is contained in:
parent
674c560494
commit
4f0d275e13
@ -120,6 +120,16 @@ void
|
|||||||
runOnLoadIfFound(Thread* t, System::Library* library)
|
runOnLoadIfFound(Thread* t, System::Library* library)
|
||||||
{
|
{
|
||||||
void* p = library->resolve("JNI_OnLoad");
|
void* p = library->resolve("JNI_OnLoad");
|
||||||
|
|
||||||
|
#ifdef PLATFORM_WINDOWS
|
||||||
|
if (p == 0) {
|
||||||
|
p = library->resolve("_JNI_OnLoad@8");
|
||||||
|
if (p == 0) {
|
||||||
|
p = library->resolve("JNI_OnLoad@8");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (p) {
|
if (p) {
|
||||||
jint (JNICALL * JNI_OnLoad)(Machine*, void*);
|
jint (JNICALL * JNI_OnLoad)(Machine*, void*);
|
||||||
memcpy(&JNI_OnLoad, &p, sizeof(void*));
|
memcpy(&JNI_OnLoad, &p, sizeof(void*));
|
||||||
|
@ -1747,7 +1747,7 @@ loadLibrary(Thread* t, object, uintptr_t* arguments)
|
|||||||
|
|
||||||
loadLibrary
|
loadLibrary
|
||||||
(t, static_cast<local::MyClasspath*>(t->m->classpath)->libraryPath,
|
(t, static_cast<local::MyClasspath*>(t->m->classpath)->libraryPath,
|
||||||
RUNTIME_ARRAY_BODY(n), not absolute, false);
|
RUNTIME_ARRAY_BODY(n), not absolute, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// only safe to call during bootstrap when there's only one thread
|
// only safe to call during bootstrap when there's only one thread
|
||||||
|
Loading…
Reference in New Issue
Block a user