Exemplo n.º 1
0
            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;
            }
Exemplo n.º 2
0
            private int GetChunkIndex(int size)
            {
                int num  = BitOperation.CountLeadingZeroes(size - 1);
                int num2 = 28 - num;

                if (num2 < 0)
                {
                    num2 = 0;
                }
                return(num2);
            }