Beispiel #1
0
void* rvmAllocateMemoryUncollectable(Env* env, jint size) {
    void* m = gcAllocateUncollectable(size);
    if (!m) {
        rvmThrowOutOfMemoryError(env);
        return NULL;
    }
    return m;
}
Beispiel #2
0
Env* rvmCreateEnv(VM* vm) {
    Env* env = gcAllocateUncollectable(vm->options->enableHooks ? sizeof(DebugEnv) : sizeof(Env));
    if (!env) return NULL;
    env->vm = vm;
    if(vm->options->enableHooks) {
        DebugEnv* debugEnv = (DebugEnv*)env;
        debugEnv->reqId = 0;
        debugEnv->suspended = FALSE;
    }
    rvmInitJNIEnv(env);
    return env;
}