本文整理汇总了C#中Softec.AprSharp.AprPool.Destroy方法的典型用法代码示例。如果您正苦于以下问题:C# AprPool.Destroy方法的具体用法?C# AprPool.Destroy怎么用?C# AprPool.Destroy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Softec.AprSharp.AprPool
的用法示例。
在下文中一共展示了AprPool.Destroy方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AllocLoop
public void AllocLoop()
{
AprPool p = new AprPool();
Assert.IsTrue(p.IsNull,"#G000001");
p = AprPool.Create();
Assert.IsFalse(p.IsNull,"#G000002");
for(int i=24;i<4096;i+=24)
{
Assert.IsTrue(p.Alloc(i).ToInt32() != 0,String.Format("#G{0,6}",i));
}
p.Destroy();
Assert.IsTrue(p.IsNull,"#G000004");
}
示例2: Alloc
public void Alloc()
{
AprPool p = new AprPool();
Assert.IsTrue(p.IsNull,"#E01");
p = AprPool.Create();
Assert.IsFalse(p.IsNull,"#E02");
Assert.IsTrue(p.Alloc(128).ToInt32() != 0,"#E03");
Assert.IsTrue(p.Alloc(256).ToInt32() != 0,"#E04");
Assert.IsTrue(p.Alloc(512).ToInt32() != 0,"#E05");
Assert.IsTrue(p.Alloc(1024).ToInt32() != 0,"#E06");
Assert.IsTrue(p.Alloc(2048).ToInt32() != 0,"#E07");
Assert.IsTrue(p.Alloc(4096).ToInt32() != 0,"#E08");
Assert.IsTrue(p.Alloc(6148).ToInt32() != 0,"#E09");
Assert.IsTrue(p.Alloc(9216).ToInt32() != 0,"#E10");
Assert.IsTrue(p.Alloc(12265).ToInt32() != 0,"#E11");
Assert.IsTrue(p.Alloc(16384).ToInt32() != 0,"#E12");
p.Destroy();
Assert.IsTrue(p.IsNull,"#E13");
}
示例3: CAlloc
public void CAlloc()
{
AprPool p = new AprPool();
Assert.IsTrue(p.IsNull,"#F01");
p = AprPool.Create();
Assert.IsFalse(p.IsNull,"#F02");
IntPtr m = p.CAlloc(256);
Assert.IsTrue(m.ToInt32() != 0,"#F03");
Assert.IsTrue(Marshal.ReadInt32(m) == 0,"#F04");
p.Destroy();
Assert.IsTrue(p.IsNull,"#F04");
}
示例4: CreateDestroySubPoolWithCustomAllocator
public void CreateDestroySubPoolWithCustomAllocator()
{
AprPool p = new AprPool();
Assert.IsTrue(p.IsNull,"#D01");
p = AprPool.Create();
Assert.IsFalse(p.IsNull,"#D02");
AprAllocator a = AprAllocator.Create();
Assert.IsFalse(a.IsNull,"#D03");
AprPool sp = AprPool.Create(p,a);
Assert.IsFalse(sp.IsNull,"#D04");
Assert.AreEqual(((IntPtr)p).ToInt32(),((IntPtr)(sp.Parent)).ToInt32(),"#D05");
Assert.AreEqual(((IntPtr)a).ToInt32(),((IntPtr)(sp.Allocator)).ToInt32(),"#D06");
a.Owner = p;
Assert.AreEqual(((IntPtr)p).ToInt32(),((IntPtr)(a.Owner)).ToInt32(),"#D07");
sp.Destroy();
Assert.IsTrue(sp.IsNull,"#D08");
p.Destroy();
Assert.IsTrue(p.IsNull,"#D09");
}
示例5: CreateDestroySubPool
public void CreateDestroySubPool()
{
AprPool p = new AprPool();
Assert.IsTrue(p.IsNull,"#B01");
p = AprPool.Create();
Assert.IsFalse(p.IsNull,"#B02");
AprPool sp = AprPool.Create(p);
Assert.IsFalse(sp.IsNull,"#B03");
Assert.AreEqual(((IntPtr)p).ToInt32(),((IntPtr)(sp.Parent)).ToInt32(),"#B04");
sp.Destroy();
Assert.IsTrue(sp.IsNull,"#B05");
p.Destroy();
Assert.IsTrue(p.IsNull,"#B06");
}
示例6: CreateDestroy
public void CreateDestroy()
{
AprPool p = new AprPool();
Assert.IsTrue(p.IsNull,"#A01");
p = AprPool.Create();
Assert.IsFalse(p.IsNull,"#A02");
p.Destroy();
Assert.IsTrue(p.IsNull,"#A03");
}
示例7: CAllocLoop
public void CAllocLoop()
{
AprPool p = new AprPool();
Assert.IsTrue(p.IsNull,"#H000001");
p = AprPool.Create();
Assert.IsFalse(p.IsNull,"#H000002");
for(int i=24;i<4096;i+=24)
{
IntPtr m = p.CAlloc(i);
Assert.IsTrue(m.ToInt32() != 0,String.Format("#H{0,6}a",i));
Assert.IsTrue(Marshal.ReadInt32(m) == 0,String.Format("#H{0,6}b",i));
Assert.IsTrue(p.Alloc(i).ToInt32() != 0,String.Format("#H{0,6}c",i));
}
p.Destroy();
Assert.IsTrue(p.IsNull,"#H000004");
}