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