Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 public static AprPool Create(AprAllocator allocator)
 {
     return(Create(IntPtr.Zero, allocator));
 }
Exemplo n.º 4
0
 public static AprPool Create(AprAllocator allocator)
 {
     return(Create(IntPtr.Zero, allocator));
 }
Exemplo n.º 5
0
 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;
 }
Exemplo n.º 6
0
        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");
        }
Exemplo n.º 7
0
 public static AprPool PoolCreate(AprPool pool, AprAllocator allocator)
 {
 	AprPool newpool = AprPool.Create(pool, allocator);
 	allocator.Owner = pool;
     return(newpool);
 }