public unsafe UnmanagedAllocatorContext(short id)
            {
                this.id = id;
                int num = 27 - BitOperation.CountLeadingZeroes(UnmanagedAllocator.ThreadPoolSize);

                this.chunkHeader = new byte *[num];
                this.allocHandle = UnmanagedAllocator.RequestPool();
                this.currentPage = this.allocHandle;
                this.releaseHead = IntPtr.Zero;
            }
            private unsafe void AllocatePage(int reqSize, int index)
            {
                int num2;
                int size = (int)BitOperation.SmallestPow2((uint)reqSize);

                if ((this.allocHandle + UnmanagedAllocator.ThreadPoolSize) <= (this.currentPage + size))
                {
                    this.ReservePage(this.GetChunkIndex(UnmanagedAllocator.pageSize), UnmanagedAllocator.pageSize, ((int)((long)(((this.allocHandle + UnmanagedAllocator.ThreadPoolSize) - this.currentPage) / 1))) / UnmanagedAllocator.pageSize);
                    this.allocHandle = UnmanagedAllocator.RequestPool();
                    this.currentPage = this.allocHandle;
                }
                if (size > UnmanagedAllocator.pageSize)
                {
                    num2 = 1;
                }
                else
                {
                    num2 = UnmanagedAllocator.pageSize / size;
                }
                this.ReservePage(index, size, num2);
            }
 internal unsafe void Release()
 {
     UnmanagedAllocator.Release(this.address);
 }
 internal unsafe UnmanagedBuffer(int count)
 {
     this.address = (byte *)UnmanagedAllocator.Allocate(count).ToPointer();
     this.count   = count;
 }
 public static void Initialize()
 {
     UnmanagedAllocator.Initialize(4096, 1048576, 67108864);
 }
 public unsafe static void Release(IntPtr address)
 {
     UnmanagedAllocator.Release((byte *)address.ToPointer());
 }