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); }
internal ManagedJNIEnv() { pJNIEnv = (JNIEnv*)JniMem.Alloc(sizeof(JNIEnv)); localRefs = new object[32][]; active = localRefs[0] = new object[LOCAL_REF_INITIAL_BUCKET_SIZE]; // stuff something in the first entry to make sure we don't hand out a zero handle // (a zero handle corresponds to a null reference) active[0] = ""; localRefIndex = 1; }
internal JNetRuntime(JNIEnv *env) { this.env = env; this.functions = env->functions; }
internal static extern JNI.Result JNI_CreateJavaVM(out JavaVM *jvm, out JNIEnv *env, JavaVMInitArgs *args);