public void ReleaseOptions() { var ptr = options; if (ptr == IntPtr.Zero) { return; } var n = nOptions; options = IntPtr.Zero; nOptions = 0; var sz = Marshal.SizeOf <JavaVMOption>(); var current = ptr; while (n-- > 0) { Marshal.DestroyStructure <JavaVMOption>(current); current += sz; } Marshal.FreeCoTaskMem(ptr); }
public void SetOptions(JavaVMOption[] options) { var sz = Marshal.SizeOf <JavaVMOption>(); var len = options.Length; var ptr = Marshal.AllocCoTaskMem(len * sz); var current = ptr; foreach (var option in options) { Marshal.StructureToPtr(option, current, false); current += sz; } this.options = ptr; this.nOptions = len; }
public void Cast_int_values_to_jint_and_vice_versa(int value) { jint ji_value = value; Assert.Equal <int>(value, ji_value); }
public void Check_jint_default_value() { jint ji_value = default; Assert.Equal <int>(0, ji_value); }