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

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