private static void Runtime_MemoryChanging(object sender, JavaScriptMemoryAllocationEventArgs e) { Console.WriteLine($"Allocation/Change: {e.Type} :: {e.Amount}"); }
private static bool MemoryCallbackThunk(IntPtr callbackState, JavaScriptMemoryAllocationEventType allocationEvent, UIntPtr allocationSize) { GCHandle handle = GCHandle.FromIntPtr(callbackState); JavaScriptRuntime runtime = handle.Target as JavaScriptRuntime; if (runtime == null) { Debug.Assert(false, "Runtime has been freed."); return false; } var args = new JavaScriptMemoryAllocationEventArgs(allocationSize, allocationEvent); runtime.OnMemoryChanging(args); if (args.IsCancelable && args.Cancel) return false; return true; }
private void Rt_MemoryChanging(object sender, JavaScriptMemoryAllocationEventArgs e) { System.Diagnostics.Debugger.Log(0, "Log", $"Allocation/Change: {e.Type} :: {e.Amount}"); }
private void OnMemoryChanging(JavaScriptMemoryAllocationEventArgs args) { var changing = MemoryChanging; if (changing != null) { changing(this, args); } }
private void Runtime__MemoryChanging(object sender, JavaScriptMemoryAllocationEventArgs e) { Log.Message(string.Format("{0}: {1:x}", e.Type, e.Amount)); Assert.Succeeded(); }