Пример #1
0
 private static void Runtime_MemoryChanging(object sender, JavaScriptMemoryAllocationEventArgs e)
 {
     Console.WriteLine($"Allocation/Change: {e.Type} :: {e.Amount}");
 }
Пример #2
0
        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;
        }
Пример #3
0
 private void Rt_MemoryChanging(object sender, JavaScriptMemoryAllocationEventArgs e)
 {
     System.Diagnostics.Debugger.Log(0, "Log", $"Allocation/Change: {e.Type} :: {e.Amount}");
 }
Пример #4
0
 private void OnMemoryChanging(JavaScriptMemoryAllocationEventArgs args)
 {
     var changing = MemoryChanging;
     if (changing != null)
     {
         changing(this, args);
     }
 }
Пример #5
0
 private void Runtime__MemoryChanging(object sender, JavaScriptMemoryAllocationEventArgs e)
 {
     Log.Message(string.Format("{0}: {1:x}", e.Type, e.Amount));
     Assert.Succeeded();
 }