Alloc() public static method

public static Alloc ( object real ) : long
real object
return long
Ejemplo n.º 1
0
        public static void InitProxy(JNIEnv env, JniLocalHandle obj, object real)
        {
            long handle = IntHandle.Alloc(real);

            env.CallVoidMethod(obj, __IClrProxy._initProxy1, new Value {
                _long = handle
            });
        }
Ejemplo n.º 2
0
        internal JniLocalHandle CreateJVMProxy(JNIEnv env, object obj)
        {
            throw new JNIException("you have to bind native method in order to create proxies to CLR types");
            long handle = IntHandle.Alloc(obj);

            return(env.NewObjectPtr(JVMProxy.jvmHandle, JVMConstructor, new Value(), new Value {
                _long = handle
            }));
        }
Ejemplo n.º 3
0
        private static void RegisterTypeOf(RegistryRecord record, JNIEnv env)
        {
            MethodId constructor = knownCLR[typeof(Type)].JVMConstructor;
            var      h           = new Value {
                _long = IntHandle.Alloc(record.CLRInterface)
            };
            var clazz    = Type_._class.jvmHandle;
            var typeInfo = new Value {
                _object = env.NewObjectPtr(clazz, constructor, Value.Null, h)
            };

            env.CallStaticVoidMethod(record.JVMStatic, "InitJNI", "(Lnet/sf/jni4net/inj/INJEnv;Lsystem/Type;)V",
                                     new[] { Value.Null, typeInfo });
            //record.JVMStatic.Invoke("InitJNI", "(Lnet/sf/jni4net/inj/INJEnv;Lsystem/Type;)V", null, record.CLRInterface);
        }