private static JNetVirtualMachine Boot(IJNetBootstrap bootstrap, JavaVM *vm, JNIEnv *env) { var instance = new JNetVirtualMachine(vm); if (bootstrap is not null) { var runtime = new JNetRuntime(env); try { bootstrap.Startup(instance, runtime); } catch { instance.Destroy(); throw; } } return(instance); }
static JavaVM() { JNI.jvmCreated = true; pJavaVM = (JavaVM*)(void*)JniMem.Alloc(IntPtr.Size * (1 + vtableDelegates.Length)); pJavaVM->vtable = &pJavaVM->firstVtableEntry; for(int i = 0; i < vtableDelegates.Length; i++) { pJavaVM->vtable[i] = JniHelper.ikvm_MarshalDelegate(vtableDelegates[i]); } }
internal static extern JNI.Result JNI_GetCreatedJavaVMs(out JavaVM *jvm, int bufferLength, out int createdVMs);
private JNetVirtualMachine(JavaVM *vm) { this.vm = vm; }
internal static extern JNI.Result JNI_CreateJavaVM(out JavaVM *jvm, out JNIEnv *env, JavaVMInitArgs *args);