public static AprPool Create(AprPool pool, AprAllocator allocator) { IntPtr ptr; Debug.Write(String.Format("apr_pool_create_ex({0},{1})...", pool, allocator)); int res = Apr.apr_pool_create_ex(out ptr, pool, IntPtr.Zero, allocator); if (res != 0) { throw new AprException(res); } Debug.WriteLine(String.Format("Done({0:X})", ((Int32)ptr))); return(ptr); }
public static AprPool Create(AprPool pool, AprAllocator allocator) { IntPtr ptr; Debug.Write(String.Format("apr_pool_create_ex({0},{1})...",pool,allocator)); int res = Apr.apr_pool_create_ex(out ptr, pool, IntPtr.Zero, allocator); if(res != 0 ) throw new AprException(res); Debug.WriteLine(String.Format("Done({0:X})",((Int32)ptr))); return(ptr); }
public static AprPool Create(AprAllocator allocator) { return(Create(IntPtr.Zero, allocator)); }
private AprMemNode AllocHelper(AprAllocator a, int size, string test) { AprMemNode m = a.Alloc(size); Assert.IsFalse(m.IsNull,test+"a"); if( (size+24) <= 8192 ) { Assert.AreEqual(1,m.NativeIndex,test+"c"); Assert.AreEqual((8192-24),(m.EndP.ToInt32()-m.FirstAvail.ToInt32()),test+"d"); } else { Assert.AreEqual((size-4097+24)/4096+1,m.NativeIndex,test+"c"); Assert.AreEqual((m.NativeIndex-1)*4096+(8192-24),(m.EndP.ToInt32()-m.FirstAvail.ToInt32()),test+"d"); } return m; }
public void CreateDestroy() { AprAllocator a = new AprAllocator(); Assert.IsTrue(a.IsNull,"#A01"); a = AprAllocator.Create(); Assert.IsFalse(a.IsNull,"#A02"); a.Destroy(); Assert.IsTrue(a.IsNull,"#A03"); }
public static AprPool PoolCreate(AprPool pool, AprAllocator allocator) { AprPool newpool = AprPool.Create(pool, allocator); allocator.Owner = pool; return(newpool); }