mirror of
https://github.com/corda/corda.git
synced 2025-01-19 03:06:36 +00:00
remove Machine::lastLibrary and rename firstLibrary to libraries
This commit is contained in:
parent
7a262d0578
commit
d693393293
@ -527,7 +527,8 @@ Java_java_lang_Runtime_load(Thread* t, jclass, jstring name, jboolean mapName)
|
||||
}
|
||||
}
|
||||
|
||||
for (System::Library* lib = t->m->firstLibrary; lib; lib = lib->next()) {
|
||||
System::Library* last;
|
||||
for (System::Library* lib = t->m->libraries; lib; lib = lib->next()) {
|
||||
if (lib->name()
|
||||
and strcmp(lib->name(), n) == 0
|
||||
and lib->mapName() == mapName)
|
||||
@ -535,12 +536,12 @@ Java_java_lang_Runtime_load(Thread* t, jclass, jstring name, jboolean mapName)
|
||||
// already loaded
|
||||
return;
|
||||
}
|
||||
last = lib;
|
||||
}
|
||||
|
||||
System::Library* lib;
|
||||
if (LIKELY(t->m->system->success(t->m->system->load(&lib, n, mapName)))) {
|
||||
t->m->lastLibrary->setNext(lib);
|
||||
t->m->lastLibrary = lib;
|
||||
last->setNext(lib);
|
||||
} else {
|
||||
object message = makeString(t, "library not found: %s", n);
|
||||
t->exception = makeUnsatisfiedLinkError(t, message);
|
||||
|
@ -1652,7 +1652,7 @@ Machine::Machine(System* system, Heap* heap, Finder* finder,
|
||||
heapLock(0),
|
||||
classLock(0),
|
||||
referenceLock(0),
|
||||
firstLibrary(0),
|
||||
libraries(0),
|
||||
loader(0),
|
||||
bootstrapClassMap(0),
|
||||
monitorMap(0),
|
||||
@ -1676,12 +1676,10 @@ Machine::Machine(System* system, Heap* heap, Finder* finder,
|
||||
not system->success(system->make(&heapLock)) or
|
||||
not system->success(system->make(&classLock)) or
|
||||
not system->success(system->make(&referenceLock)) or
|
||||
not system->success(system->load(&firstLibrary, 0, false)))
|
||||
not system->success(system->load(&libraries, 0, false)))
|
||||
{
|
||||
system->abort();
|
||||
}
|
||||
|
||||
lastLibrary = firstLibrary;
|
||||
}
|
||||
|
||||
void
|
||||
@ -1693,8 +1691,8 @@ Machine::dispose()
|
||||
classLock->dispose();
|
||||
referenceLock->dispose();
|
||||
|
||||
if (firstLibrary) {
|
||||
firstLibrary->disposeAll();
|
||||
if (libraries) {
|
||||
libraries->disposeAll();
|
||||
}
|
||||
|
||||
for (Reference* r = jniReferences; r;) {
|
||||
|
@ -1141,8 +1141,7 @@ class Machine {
|
||||
System::Monitor* heapLock;
|
||||
System::Monitor* classLock;
|
||||
System::Monitor* referenceLock;
|
||||
System::Library* firstLibrary;
|
||||
System::Library* lastLibrary;
|
||||
System::Library* libraries;
|
||||
object loader;
|
||||
object bootstrapClassMap;
|
||||
object monitorMap;
|
||||
|
@ -121,7 +121,7 @@ makeJNIName(Thread* t, char* name, object method, bool decorate)
|
||||
void*
|
||||
resolveNativeMethod(Thread* t, const char* undecorated, const char* decorated)
|
||||
{
|
||||
for (System::Library* lib = t->m->firstLibrary; lib; lib = lib->next()) {
|
||||
for (System::Library* lib = t->m->libraries; lib; lib = lib->next()) {
|
||||
void* p = lib->resolve(undecorated);
|
||||
if (p) {
|
||||
return p;
|
||||
|
Loading…
Reference in New Issue
Block a user