Hi Archie,

On Mon, 2006-02-13 at 15:31 -0600, Archie Cobbs wrote:
> Mark Wielaard wrote:
> > For now to get things working I just reintroduced the loadLibrary() call
> > in the Math static initializer. This should work as before the
> > Math/VMMath split even though it is a little ugly.
> 
> Dumb question: what's wrong with calling System.loadLibrary() from
> within System or Runtime static initializers? Does this cause an
> infinite loop? If so what's the loop?

Good question! As it turns out I only thought it would create a cycle.

The reason it didn't work was something else. Both cacao and jamvm have
their own VMRuntime implementation (and cacao also its own VMSystem). So
while I fixed those classes in the vm/reference implementation to
explicitly load the "javalang" JNI lib both these runtimes didn't pick
that up. Adding the System.loadLibrary("javalang") to the static
initializer of the VMRuntime that these runtimes actually use (and
removing the workaround in Math) works just fine.

I'll think about correctly formulating the bootstrap issue concerning
loadLibrary() and "javalang" lib for the runtime and propose an text for
the vm integration guide explaining how to handle it when a runtime
wants to dynamically load the reference "javalang" JNI implementation.

Thanks for asking the "why?" question. Clearly I thought too quickly and
was too happy with having a quick-fix workaround.

Cheers,

Mark

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to