public SafeJvmAllocHandle Allocate(long size) { IntPtr result; ThrowOnFailure(_rawInterface.Allocate(_env, size, out result)); return(new SafeJvmAllocHandle(this, result, true)); }
public jvmtiError Allocate(JvmVirtualMachineRemoteHandle virtualMachine, long size, out long address) { JavaVM machine = JavaVM.GetInstance(virtualMachine); jvmtiError result = jvmtiError.Internal; IntPtr memory = IntPtr.Zero; machine.InvokeOnJvmThread( (environment) => { jvmtiInterface rawInterface = environment.RawInterface; result = rawInterface.Allocate(environment.Handle, size, out memory); }); address = memory.ToInt64(); return(result); }