Csharp/C Sharp by API/System.Runtime/MemoryFailPoint — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 12:12, 26 мая 2010
new MemoryFailPoint
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.rupilerServices;
public class MainClass
{
public static void Main()
{
using (System.Runtime.MemoryFailPoint gate = new System.Runtime.MemoryFailPoint(100))
{
// Some operation that actually uses the 100MB of memory�
Console.WriteLine("Success for 100MB fail-point");
}
using (System.Runtime.MemoryFailPoint gate = new System.Runtime.MemoryFailPoint(1024*100))
{
// Some operation that actually uses the 100GB of memory�
Console.WriteLine("Success for 100GB fail-point");
}
}
}